Rename attributeOwnerIdBeforeInline to originalBeforeInline

This commit is contained in:
Ivan Kylchik
2023-02-13 14:16:54 +01:00
committed by Space Team
parent d148231bce
commit 4fc95624a0
20 changed files with 35 additions and 35 deletions
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.ir.IrElement
* useful, for example, to keep track of generated names for anonymous declarations.
* @property attributeOwnerId original element before copying. Always satisfies the following
* invariant: this.attributeOwnerId == this.attributeOwnerId.attributeOwnerId.
* @property attributeOwnerIdBeforeInline original element before inlining. Useful only with IR
* @property originalBeforeInline original element before inlining. Useful only with IR
* inliner. null if the element wasn't inlined. Unlike [attributeOwnerId], doesn't have the
* idempotence invariant and can contain a chain of declarations.
* @sample org.jetbrains.kotlin.ir.generator.IrTree.attributeContainer
@@ -23,5 +23,5 @@ import org.jetbrains.kotlin.ir.IrElement
interface IrAttributeContainer : IrElement {
var attributeOwnerId: IrAttributeContainer
var attributeOwnerIdBeforeInline: IrAttributeContainer?
var originalBeforeInline: IrAttributeContainer?
}
@@ -22,7 +22,7 @@ abstract class IrExpression : IrElementBase(), IrStatement, IrVarargElement,
IrAttributeContainer {
override var attributeOwnerId: IrAttributeContainer = this
override var attributeOwnerIdBeforeInline: IrAttributeContainer? = null
override var originalBeforeInline: IrAttributeContainer? = null
abstract var type: IrType
@@ -17,7 +17,7 @@ import java.io.File
fun <D : IrAttributeContainer> D.copyAttributes(other: IrAttributeContainer?): D = apply {
if (other != null) {
attributeOwnerId = other.attributeOwnerId
attributeOwnerIdBeforeInline = other.attributeOwnerIdBeforeInline
originalBeforeInline = other.originalBeforeInline
}
}
@@ -57,7 +57,7 @@ open class IrClassImpl(
override var metadata: MetadataSource? = null
override var attributeOwnerId: IrAttributeContainer = this
override var attributeOwnerIdBeforeInline: IrAttributeContainer? = null
override var originalBeforeInline: IrAttributeContainer? = null
override var sealedSubclasses: List<IrClassSymbol> = emptyList()
}
@@ -64,7 +64,7 @@ abstract class IrFunctionCommonImpl(
@Suppress("LeakingThis")
override var attributeOwnerId: IrAttributeContainer = this
override var attributeOwnerIdBeforeInline: IrAttributeContainer? = null
override var originalBeforeInline: IrAttributeContainer? = null
override var correspondingPropertySymbol: IrPropertySymbol? = null
}
@@ -45,7 +45,7 @@ abstract class IrPropertyCommonImpl(
override var metadata: MetadataSource? = null
override var attributeOwnerId: IrAttributeContainer = this
override var attributeOwnerIdBeforeInline: IrAttributeContainer? = null
override var originalBeforeInline: IrAttributeContainer? = null
}
class IrPropertyImpl(
@@ -108,7 +108,7 @@ class IrLazyClass(
}
override var attributeOwnerId: IrAttributeContainer = this
override var attributeOwnerIdBeforeInline: IrAttributeContainer? = null
override var originalBeforeInline: IrAttributeContainer? = null
val classProto: ProtoBuf.Class? get() = (descriptor as? DeserializedClassDescriptor)?.classProto
val nameResolver: NameResolver? get() = (descriptor as? DeserializedClassDescriptor)?.c?.nameResolver
@@ -104,9 +104,9 @@ class IrLazyFunction(
get() = this
set(_) = error("We should never need to change attributeOwnerId of external declarations.")
override var attributeOwnerIdBeforeInline: IrAttributeContainer?
override var originalBeforeInline: IrAttributeContainer?
get() = null
set(_) = error("We should never need to change attributeOwnerIdBeforeInline of external declarations.")
set(_) = error("We should never need to change originalBeforeInline of external declarations.")
override var correspondingPropertySymbol: IrPropertySymbol? = null
@@ -89,7 +89,7 @@ class IrLazyProperty(
get() = this
set(_) = error("We should never need to change attributeOwnerId of external declarations.")
override var attributeOwnerIdBeforeInline: IrAttributeContainer?
override var originalBeforeInline: IrAttributeContainer?
get() = this
set(_) = error("We should never need to change attributeOwnerIdBeforeInline of external declarations.")
set(_) = error("We should never need to change originalBeforeInline of external declarations.")
}
@@ -175,13 +175,13 @@ object IrTree : AbstractTreeBuilder() {
useful, for example, to keep track of generated names for anonymous declarations.
@property attributeOwnerId original element before copying. Always satisfies the following
invariant: `this.attributeOwnerId == this.attributeOwnerId.attributeOwnerId`.
@property attributeOwnerIdBeforeInline original element before inlining. Useful only with IR
@property originalBeforeInline original element before inlining. Useful only with IR
inliner. `null` if the element wasn't inlined. Unlike [attributeOwnerId], doesn't have the
idempotence invariant and can contain a chain of declarations.
""".trimIndent()
+field("attributeOwnerId", attributeContainer)
+field("attributeOwnerIdBeforeInline", attributeContainer, nullable = true) // null <=> this element wasn't inlined
+field("originalBeforeInline", attributeContainer, nullable = true) // null <=> this element wasn't inlined
}
val anonymousInitializer: ElementConfig by element(Declaration) {
visitorParent = declarationBase
@@ -507,7 +507,7 @@ object IrTree : AbstractTreeBuilder() {
+field("attributeOwnerId", attributeContainer) {
baseDefaultValue = code("this")
}
+field("attributeOwnerIdBeforeInline", attributeContainer, nullable = true) {
+field("originalBeforeInline", attributeContainer, nullable = true) {
baseDefaultValue = code("null")
}
+field("type", irTypeType)