[IR] Push default values from base to implementation classes
The default value of those properties is a detail that should be handled by implementation or builder layer. This change will also simplify auto-generating and reasoning about generated implementation classes, and allow for potential further enhancements like intercepting all mutations. ^KT-65773 In Progress
This commit is contained in:
committed by
Space Team
parent
5921706a15
commit
83bc12949b
+4
@@ -15,6 +15,7 @@ import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.backend.js.JsCommonBackendContext
|
||||
import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrVariable
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
@@ -52,6 +53,9 @@ class IrDispatchPoint(val target: SuspendState) : IrExpression() {
|
||||
set(value) {
|
||||
target.entryBlock.type = value
|
||||
}
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D) = visitor.visitExpression(this, data)
|
||||
}
|
||||
|
||||
@@ -855,6 +855,9 @@ class FunctionInlining(
|
||||
symbol.owner.type = value
|
||||
}
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D) =
|
||||
visitor.visitGetValue(this, data)
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
* Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.errorDeclaration]
|
||||
*/
|
||||
abstract class IrErrorDeclaration : IrDeclarationBase() {
|
||||
override val symbol: IrSymbol
|
||||
get() = error("Should never be called")
|
||||
abstract override val symbol: IrSymbol
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitErrorDeclaration(this, data)
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.ir.IrBuiltIns
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.IrElementBase
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.util.transformInPlace
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
@@ -32,12 +31,6 @@ abstract class IrModuleFragment : IrElementBase(), IrElement {
|
||||
|
||||
abstract val files: MutableList<IrFile>
|
||||
|
||||
override val startOffset: Int
|
||||
get() = UNDEFINED_OFFSET
|
||||
|
||||
override val endOffset: Int
|
||||
get() = UNDEFINED_OFFSET
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitModuleFragment(this, data)
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@ package org.jetbrains.kotlin.ir.expressions
|
||||
abstract class IrBreakContinue : IrExpression() {
|
||||
abstract var loop: IrLoop
|
||||
|
||||
var label: String? = null
|
||||
abstract var label: String?
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.util.transformInPlace
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
@@ -21,8 +20,6 @@ import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
abstract class IrContainerExpression : IrExpression(), IrStatementContainer {
|
||||
abstract var origin: IrStatementOrigin?
|
||||
|
||||
override val statements: MutableList<IrStatement> = ArrayList(2)
|
||||
|
||||
override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) {
|
||||
statements.forEach { it.accept(visitor, data) }
|
||||
}
|
||||
|
||||
@@ -20,10 +20,6 @@ import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
* Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.expression]
|
||||
*/
|
||||
abstract class IrExpression : IrElementBase(), IrStatement, IrVarargElement, IrAttributeContainer {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
abstract var type: IrType
|
||||
|
||||
override fun <D> transform(transformer: IrElementTransformer<D>, data: D): IrExpression =
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ abstract class IrFieldAccessExpression : IrDeclarationReference() {
|
||||
|
||||
abstract var superQualifierSymbol: IrClassSymbol?
|
||||
|
||||
var receiver: IrExpression? = null
|
||||
abstract var receiver: IrExpression?
|
||||
|
||||
abstract var origin: IrStatementOrigin?
|
||||
}
|
||||
|
||||
@@ -16,9 +16,9 @@ package org.jetbrains.kotlin.ir.expressions
|
||||
abstract class IrLoop : IrExpression() {
|
||||
abstract var origin: IrStatementOrigin?
|
||||
|
||||
var body: IrExpression? = null
|
||||
abstract var body: IrExpression?
|
||||
|
||||
abstract var condition: IrExpression
|
||||
|
||||
var label: String? = null
|
||||
abstract var label: String?
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,9 +20,9 @@ import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
* Generated from: [org.jetbrains.kotlin.ir.generator.IrTree.memberAccessExpression]
|
||||
*/
|
||||
abstract class IrMemberAccessExpression<S : IrSymbol> : IrDeclarationReference() {
|
||||
var dispatchReceiver: IrExpression? = null
|
||||
abstract var dispatchReceiver: IrExpression?
|
||||
|
||||
var extensionReceiver: IrExpression? = null
|
||||
abstract var extensionReceiver: IrExpression?
|
||||
|
||||
abstract override val symbol: S
|
||||
|
||||
|
||||
+4
@@ -14,6 +14,7 @@ import org.jetbrains.kotlin.ir.declarations.IrDeclarationParent
|
||||
import org.jetbrains.kotlin.ir.declarations.IrErrorDeclaration
|
||||
import org.jetbrains.kotlin.ir.descriptors.toIrBasedDescriptor
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSymbol
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
class IrErrorDeclarationImpl @IrImplementationDetail constructor(
|
||||
@@ -25,6 +26,9 @@ class IrErrorDeclarationImpl @IrImplementationDetail constructor(
|
||||
override val descriptor: DeclarationDescriptor
|
||||
get() = _descriptor ?: this.toIrBasedDescriptor()
|
||||
|
||||
override val symbol: IrSymbol
|
||||
get() = error("Should never be called")
|
||||
|
||||
override var origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
|
||||
+7
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.ir.declarations.impl
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.ir.IrBuiltIns
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.declarations.IrModuleFragment
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
@@ -27,6 +28,12 @@ class IrModuleFragmentImpl(
|
||||
override val irBuiltins: IrBuiltIns,
|
||||
files: List<IrFile> = emptyList(),
|
||||
) : IrModuleFragment() {
|
||||
override val startOffset: Int
|
||||
get() = UNDEFINED_OFFSET
|
||||
|
||||
override val endOffset: Int
|
||||
get() = UNDEFINED_OFFSET
|
||||
|
||||
override val name: Name get() = descriptor.name
|
||||
|
||||
override val files: MutableList<IrFile> = files.toMutableList()
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
|
||||
@@ -26,6 +27,11 @@ class IrBlockImpl(
|
||||
override var type: IrType,
|
||||
override var origin: IrStatementOrigin? = null,
|
||||
) : IrBlock() {
|
||||
override val statements: MutableList<IrStatement> = ArrayList(2)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrBreak
|
||||
import org.jetbrains.kotlin.ir.expressions.IrLoop
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -25,4 +26,9 @@ class IrBreakImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType,
|
||||
override var loop: IrLoop,
|
||||
) : IrBreak()
|
||||
) : IrBreak() {
|
||||
override var label: String? = null
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -39,13 +40,17 @@ class IrCallImpl(
|
||||
override var origin: IrStatementOrigin? = null,
|
||||
override var superQualifierSymbol: IrClassSymbol? = null
|
||||
) : IrCall() {
|
||||
|
||||
override val typeArguments: Array<IrType?> = initializeTypeArguments(typeArgumentsCount)
|
||||
|
||||
override var dispatchReceiver: IrExpression? = null
|
||||
override var extensionReceiver: IrExpression? = null
|
||||
override val valueArguments: Array<IrExpression?> = initializeParameterArguments(valueArgumentsCount)
|
||||
|
||||
override var contextReceiversCount = 0
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
init {
|
||||
if (symbol is IrConstructorSymbol) {
|
||||
throw AssertionError("Should be IrConstructorCall: ${this.render()}")
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrClassReference
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -26,4 +27,7 @@ class IrClassReferenceImpl(
|
||||
override var type: IrType,
|
||||
override var symbol: IrClassifierSymbol,
|
||||
override var classType: IrType
|
||||
) : IrClassReference()
|
||||
) : IrClassReference() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrComposite
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -27,6 +28,11 @@ class IrCompositeImpl(
|
||||
override var type: IrType,
|
||||
override var origin: IrStatementOrigin? = null,
|
||||
) : IrComposite() {
|
||||
override val statements: MutableList<IrStatement> = ArrayList(2)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.builtins.PrimitiveType
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConst
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstKind
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -31,6 +32,9 @@ class IrConstImpl<T>(
|
||||
override var kind: IrConstKind<T>,
|
||||
override var value: T
|
||||
) : IrConst<T>() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
companion object {
|
||||
fun string(startOffset: Int, endOffset: Int, type: IrType, value: String): IrConstImpl<String> =
|
||||
IrConstImpl(startOffset, endOffset, type, IrConstKind.String, value)
|
||||
|
||||
+4
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstantArray
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstantValue
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -18,6 +19,9 @@ class IrConstantArrayImpl(
|
||||
) : IrConstantArray() {
|
||||
override val elements = SmartList(initElements)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
override fun contentEquals(other: IrConstantValue): Boolean =
|
||||
other is IrConstantArray &&
|
||||
other.type == type &&
|
||||
|
||||
+4
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -22,6 +23,9 @@ class IrConstantObjectImpl constructor(
|
||||
override val valueArguments = SmartList(initValueArguments)
|
||||
override val typeArguments = SmartList(initTypeArguments)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
override fun contentEquals(other: IrConstantValue): Boolean =
|
||||
other is IrConstantObject &&
|
||||
other.type == type &&
|
||||
|
||||
+4
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConst
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstantPrimitive
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstantValue
|
||||
@@ -14,6 +15,9 @@ class IrConstantPrimitiveImpl(
|
||||
override val endOffset: Int,
|
||||
override var value: IrConst<*>,
|
||||
) : IrConstantPrimitive() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
override fun contentEquals(other: IrConstantValue) =
|
||||
other is IrConstantPrimitive &&
|
||||
type == other.type &&
|
||||
|
||||
+6
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.ir.expressions.impl
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -30,10 +31,15 @@ class IrConstructorCallImpl(
|
||||
) : IrConstructorCall() {
|
||||
override val typeArguments: Array<IrType?> = initializeTypeArguments(typeArgumentsCount)
|
||||
|
||||
override var dispatchReceiver: IrExpression? = null
|
||||
override var extensionReceiver: IrExpression? = null
|
||||
override val valueArguments: Array<IrExpression?> = initializeParameterArguments(valueArgumentsCount)
|
||||
|
||||
override var contextReceiversCount = 0
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
companion object {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
fun fromSymbolDescriptor(
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrContinue
|
||||
import org.jetbrains.kotlin.ir.expressions.IrLoop
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -25,4 +26,9 @@ class IrContinueImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType,
|
||||
override var loop: IrLoop,
|
||||
) : IrContinue()
|
||||
) : IrContinue() {
|
||||
override var label: String? = null
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
+6
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrDelegatingConstructorCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -40,10 +41,15 @@ class IrDelegatingConstructorCallImpl(
|
||||
|
||||
override val typeArguments: Array<IrType?> = initializeTypeArguments(typeArgumentsCount)
|
||||
|
||||
override var dispatchReceiver: IrExpression? = null
|
||||
override var extensionReceiver: IrExpression? = null
|
||||
override val valueArguments: Array<IrExpression?> = initializeParameterArguments(valueArgumentsCount)
|
||||
|
||||
override var contextReceiversCount = 0
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
companion object {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
fun fromSymbolDescriptor(
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrDoWhileLoop
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -27,5 +28,10 @@ class IrDoWhileLoopImpl(
|
||||
override var type: IrType,
|
||||
override var origin: IrStatementOrigin?,
|
||||
) : IrDoWhileLoop() {
|
||||
override var label: String? = null
|
||||
override var body: IrExpression? = null
|
||||
override lateinit var condition: IrExpression
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
+5
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrDynamicMemberExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -15,4 +16,7 @@ class IrDynamicMemberExpressionImpl(
|
||||
override var type: IrType,
|
||||
override var memberName: String,
|
||||
override var receiver: IrExpression
|
||||
) : IrDynamicMemberExpression()
|
||||
) : IrDynamicMemberExpression() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
+4
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrDynamicOperator
|
||||
import org.jetbrains.kotlin.ir.expressions.IrDynamicOperatorExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
@@ -20,4 +21,7 @@ class IrDynamicOperatorExpressionImpl(
|
||||
override lateinit var receiver: IrExpression
|
||||
|
||||
override val arguments: MutableList<IrExpression> = SmartList()
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
+6
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrEnumConstructorCall
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -37,10 +38,15 @@ class IrEnumConstructorCallImpl(
|
||||
|
||||
override val typeArguments: Array<IrType?> = initializeTypeArguments(typeArgumentsCount)
|
||||
|
||||
override var dispatchReceiver: IrExpression? = null
|
||||
override var extensionReceiver: IrExpression? = null
|
||||
override val valueArguments: Array<IrExpression?> = initializeParameterArguments(valueArgumentsCount)
|
||||
|
||||
override var contextReceiversCount = 0
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
companion object {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
fun fromSymbolDescriptor(
|
||||
|
||||
+4
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrErrorCallExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -30,6 +31,9 @@ class IrErrorCallExpressionImpl(
|
||||
override var explicitReceiver: IrExpression? = null
|
||||
override val arguments: MutableList<IrExpression> = SmartList()
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
fun addArgument(argument: IrExpression) {
|
||||
arguments.add(argument)
|
||||
}
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrErrorExpression
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
|
||||
@@ -24,4 +25,7 @@ class IrErrorExpressionImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType,
|
||||
override var description: String
|
||||
) : IrErrorExpression()
|
||||
) : IrErrorExpression() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
+5
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -16,4 +17,7 @@ class IrFunctionExpressionImpl(
|
||||
override var type: IrType,
|
||||
override var function: IrSimpleFunction,
|
||||
override var origin: IrStatementOrigin
|
||||
) : IrFunctionExpression()
|
||||
) : IrFunctionExpression() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
+6
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionReference
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -37,8 +38,13 @@ class IrFunctionReferenceImpl(
|
||||
) : IrFunctionReference() {
|
||||
override val typeArguments: Array<IrType?> = initializeTypeArguments(typeArgumentsCount)
|
||||
|
||||
override var dispatchReceiver: IrExpression? = null
|
||||
override var extensionReceiver: IrExpression? = null
|
||||
override val valueArguments: Array<IrExpression?> = initializeParameterArguments(valueArgumentsCount)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
companion object {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
fun fromSymbolDescriptor(
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetClass
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -25,4 +26,7 @@ class IrGetClassImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType,
|
||||
override var argument: IrExpression,
|
||||
) : IrGetClass()
|
||||
) : IrGetClass() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetEnumValue
|
||||
import org.jetbrains.kotlin.ir.symbols.IrEnumEntrySymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -25,4 +26,7 @@ class IrGetEnumValueImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType,
|
||||
override var symbol: IrEnumEntrySymbol,
|
||||
) : IrGetEnumValue()
|
||||
) : IrGetEnumValue() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetField
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -31,6 +32,11 @@ class IrGetFieldImpl(
|
||||
override var origin: IrStatementOrigin? = null,
|
||||
override var superQualifierSymbol: IrClassSymbol? = null,
|
||||
) : IrGetField() {
|
||||
override var receiver: IrExpression? = null
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
constructor(
|
||||
startOffset: Int, endOffset: Int,
|
||||
symbol: IrFieldSymbol,
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetObjectValue
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -25,4 +26,7 @@ class IrGetObjectValueImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType,
|
||||
override var symbol: IrClassSymbol
|
||||
) : IrGetObjectValue()
|
||||
) : IrGetObjectValue() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrGetValue
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
import org.jetbrains.kotlin.ir.symbols.IrValueSymbol
|
||||
@@ -17,6 +18,9 @@ class IrGetValueImpl(
|
||||
override var symbol: IrValueSymbol,
|
||||
override var origin: IrStatementOrigin? = null
|
||||
) : IrGetValue() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrBranch
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
import org.jetbrains.kotlin.ir.expressions.IrWhen
|
||||
@@ -28,5 +29,8 @@ class IrIfThenElseImpl(
|
||||
override var type: IrType,
|
||||
override var origin: IrStatementOrigin? = null
|
||||
) : IrWhen() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
override val branches: MutableList<IrBranch> = SmartList()
|
||||
}
|
||||
|
||||
+6
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrFunctionAccessExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrInlinedFunctionBlock
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -20,6 +21,11 @@ class IrInlinedFunctionBlockImpl(
|
||||
override var inlinedElement: IrElement,
|
||||
override var origin: IrStatementOrigin? = null,
|
||||
) : IrInlinedFunctionBlock() {
|
||||
override val statements: MutableList<IrStatement> = ArrayList(2)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrInstanceInitializerCall
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -25,4 +26,7 @@ class IrInstanceInitializerCallImpl(
|
||||
override val endOffset: Int,
|
||||
override var classSymbol: IrClassSymbol,
|
||||
override var type: IrType,
|
||||
) : IrInstanceInitializerCall()
|
||||
) : IrInstanceInitializerCall() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
+6
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrLocalDelegatedPropertyReference
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -38,5 +39,10 @@ class IrLocalDelegatedPropertyReferenceImpl(
|
||||
) : IrLocalDelegatedPropertyReference() {
|
||||
override val typeArguments: Array<IrType?> = initializeTypeArguments(0)
|
||||
|
||||
override var dispatchReceiver: IrExpression? = null
|
||||
override var extensionReceiver: IrExpression? = null
|
||||
override val valueArguments: Array<IrExpression?> = initializeParameterArguments(0)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
+6
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrPropertyReference
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -39,5 +40,10 @@ class IrPropertyReferenceImpl(
|
||||
) : IrPropertyReference() {
|
||||
override val typeArguments: Array<IrType?> = initializeTypeArguments(typeArgumentsCount)
|
||||
|
||||
override var dispatchReceiver: IrExpression? = null
|
||||
override var extensionReceiver: IrExpression? = null
|
||||
override val valueArguments: Array<IrExpression?> = initializeParameterArguments(0)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrRawFunctionReference
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -25,4 +26,7 @@ class IrRawFunctionReferenceImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType,
|
||||
override var symbol: IrFunctionSymbol,
|
||||
) : IrRawFunctionReference()
|
||||
) : IrRawFunctionReference() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrReturn
|
||||
import org.jetbrains.kotlin.ir.symbols.IrReturnTargetSymbol
|
||||
@@ -27,4 +28,7 @@ class IrReturnImpl(
|
||||
override var type: IrType,
|
||||
override var returnTargetSymbol: IrReturnTargetSymbol,
|
||||
override var value: IrExpression
|
||||
) : IrReturn()
|
||||
) : IrReturn() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
+6
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.ir.expressions.impl
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.ir.IrStatement
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrReturnableBlock
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
import org.jetbrains.kotlin.ir.symbols.IrReturnableBlockSymbol
|
||||
@@ -20,6 +21,11 @@ class IrReturnableBlockImpl(
|
||||
override val symbol: IrReturnableBlockSymbol,
|
||||
override var origin: IrStatementOrigin? = null,
|
||||
) : IrReturnableBlock() {
|
||||
override val statements: MutableList<IrStatement> = ArrayList(2)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: FunctionDescriptor
|
||||
get() = symbol.descriptor
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrSetField
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -31,6 +32,11 @@ class IrSetFieldImpl(
|
||||
override var origin: IrStatementOrigin? = null,
|
||||
override var superQualifierSymbol: IrClassSymbol? = null,
|
||||
) : IrSetField() {
|
||||
override var receiver: IrExpression? = null
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
constructor(
|
||||
startOffset: Int, endOffset: Int,
|
||||
symbol: IrFieldSymbol,
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrSetValue
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
@@ -30,6 +31,9 @@ class IrSetValueImpl(
|
||||
override var value: IrExpression,
|
||||
override var origin: IrStatementOrigin?
|
||||
) : IrSetValue() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
init {
|
||||
if (symbol.isBound) {
|
||||
assert(symbol.owner.isAssignable) { "Only assignable IrValues can be set" }
|
||||
|
||||
+4
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStringConcatenation
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -26,6 +27,9 @@ class IrStringConcatenationImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType
|
||||
) : IrStringConcatenation() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
|
||||
+5
-1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrSuspendableExpression
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -15,4 +16,7 @@ class IrSuspendableExpressionImpl(
|
||||
override var type: IrType,
|
||||
override var suspensionPointId: IrExpression,
|
||||
override var result: IrExpression
|
||||
) : IrSuspendableExpression()
|
||||
) : IrSuspendableExpression() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
+5
-2
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.declarations.IrVariable
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrSuspensionPoint
|
||||
@@ -17,5 +18,7 @@ class IrSuspensionPointImpl(
|
||||
override var suspensionPointIdParameter: IrVariable,
|
||||
override var result: IrExpression,
|
||||
override var resumeResult: IrExpression
|
||||
) : IrSuspensionPoint()
|
||||
|
||||
) : IrSuspensionPoint() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrThrow
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -25,4 +26,7 @@ class IrThrowImpl(
|
||||
override val endOffset: Int,
|
||||
override var type: IrType,
|
||||
override var value: IrExpression,
|
||||
) : IrThrow()
|
||||
) : IrThrow() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrCatch
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrTry
|
||||
@@ -45,4 +46,7 @@ class IrTryImpl(
|
||||
override val catches: MutableList<IrCatch> = SmartList()
|
||||
|
||||
override var finallyExpression: IrExpression? = null
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrTypeOperator
|
||||
import org.jetbrains.kotlin.ir.expressions.IrTypeOperatorCall
|
||||
@@ -28,4 +29,7 @@ class IrTypeOperatorCallImpl(
|
||||
override var operator: IrTypeOperator,
|
||||
override var typeOperand: IrType,
|
||||
override var argument: IrExpression,
|
||||
) : IrTypeOperatorCall()
|
||||
) : IrTypeOperatorCall() {
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrVararg
|
||||
import org.jetbrains.kotlin.ir.expressions.IrVarargElement
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
@@ -38,4 +39,7 @@ class IrVarargImpl(
|
||||
}
|
||||
|
||||
override val elements: MutableList<IrVarargElement> = SmartList()
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
|
||||
@@ -36,4 +37,7 @@ class IrWhenImpl(
|
||||
}
|
||||
|
||||
override val branches: MutableList<IrBranch> = ArrayList(2)
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAttributeContainer
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
import org.jetbrains.kotlin.ir.expressions.IrWhileLoop
|
||||
@@ -28,4 +29,9 @@ class IrWhileLoopImpl(
|
||||
override var origin: IrStatementOrigin?,
|
||||
) : IrWhileLoop() {
|
||||
override lateinit var condition: IrExpression
|
||||
override var label: String? = null
|
||||
override var body: IrExpression? = null
|
||||
|
||||
override var attributeOwnerId: IrAttributeContainer = this
|
||||
override var originalBeforeInline: IrAttributeContainer? = null
|
||||
}
|
||||
|
||||
@@ -443,7 +443,6 @@ object IrTree : AbstractTreeBuilder() {
|
||||
fieldsToSkipInIrFactoryMethod.add("origin")
|
||||
|
||||
+field("symbol", symbolType, mutable = false) {
|
||||
baseGetter = "error(\"Should never be called\")"
|
||||
skipInIrFactory()
|
||||
}
|
||||
}
|
||||
@@ -495,13 +494,6 @@ object IrTree : AbstractTreeBuilder() {
|
||||
+field("name", type<Name>(), mutable = false)
|
||||
+field("irBuiltins", type(Packages.tree, "IrBuiltIns"), mutable = false)
|
||||
+listField("files", file, mutability = MutableList)
|
||||
additionalImports += ArbitraryImportable(Packages.tree, "UNDEFINED_OFFSET")
|
||||
+field("startOffset", int, mutable = false) {
|
||||
baseGetter = "UNDEFINED_OFFSET"
|
||||
}
|
||||
+field("endOffset", int, mutable = false) {
|
||||
baseGetter = "UNDEFINED_OFFSET"
|
||||
}
|
||||
}
|
||||
val property: Element by element(Declaration) {
|
||||
isLeaf = true
|
||||
@@ -678,14 +670,6 @@ object IrTree : AbstractTreeBuilder() {
|
||||
parent(varargElement)
|
||||
parent(attributeContainer)
|
||||
|
||||
+field("attributeOwnerId", attributeContainer, isChild = false) {
|
||||
baseDefaultValue = "this"
|
||||
skipInIrFactory()
|
||||
}
|
||||
+field("originalBeforeInline", attributeContainer, nullable = true, isChild = false) {
|
||||
baseDefaultValue = "null"
|
||||
skipInIrFactory()
|
||||
}
|
||||
+field("type", irTypeType)
|
||||
}
|
||||
val statementContainer: Element by element(Expression) {
|
||||
@@ -733,12 +717,8 @@ object IrTree : AbstractTreeBuilder() {
|
||||
|
||||
parent(declarationReference)
|
||||
|
||||
+field("dispatchReceiver", expression, nullable = true) {
|
||||
baseDefaultValue = "null"
|
||||
}
|
||||
+field("extensionReceiver", expression, nullable = true) {
|
||||
baseDefaultValue = "null"
|
||||
}
|
||||
+field("dispatchReceiver", expression, nullable = true)
|
||||
+field("extensionReceiver", expression, nullable = true)
|
||||
+symbol(s)
|
||||
+field("origin", statementOriginType, nullable = true)
|
||||
+listField("valueArguments", expression.copy(nullable = true), mutability = Array) {
|
||||
@@ -862,9 +842,6 @@ object IrTree : AbstractTreeBuilder() {
|
||||
parent(statementContainer)
|
||||
|
||||
+field("origin", statementOriginType, nullable = true)
|
||||
+listField("statements", statement, mutability = MutableList) {
|
||||
baseDefaultValue = "ArrayList(2)"
|
||||
}
|
||||
}
|
||||
val block: Element by element(Expression) {
|
||||
needAcceptMethod()
|
||||
@@ -902,9 +879,7 @@ object IrTree : AbstractTreeBuilder() {
|
||||
parent(expression)
|
||||
|
||||
+field("loop", loop, isChild = false)
|
||||
+field("label", string, nullable = true) {
|
||||
baseDefaultValue = "null"
|
||||
}
|
||||
+field("label", string, nullable = true)
|
||||
}
|
||||
val `break` by element(Expression) {
|
||||
visitorParameterName = "jump"
|
||||
@@ -1051,9 +1026,7 @@ object IrTree : AbstractTreeBuilder() {
|
||||
|
||||
+symbol(fieldSymbolType, mutable = true)
|
||||
+field("superQualifierSymbol", classSymbolType, nullable = true)
|
||||
+field("receiver", expression, nullable = true) {
|
||||
baseDefaultValue = "null"
|
||||
}
|
||||
+field("receiver", expression, nullable = true)
|
||||
+field("origin", statementOriginType, nullable = true)
|
||||
}
|
||||
val getField: Element by element(Expression) {
|
||||
@@ -1089,13 +1062,9 @@ object IrTree : AbstractTreeBuilder() {
|
||||
parent(expression)
|
||||
|
||||
+field("origin", statementOriginType, nullable = true)
|
||||
+field("body", expression, nullable = true) {
|
||||
baseDefaultValue = "null"
|
||||
}
|
||||
+field("body", expression, nullable = true)
|
||||
+field("condition", expression)
|
||||
+field("label", string, nullable = true) {
|
||||
baseDefaultValue = "null"
|
||||
}
|
||||
+field("label", string, nullable = true)
|
||||
}
|
||||
val whileLoop: Element by element(Expression) {
|
||||
visitorParameterName = "loop"
|
||||
|
||||
+12
-7
@@ -11,8 +11,7 @@ import org.jetbrains.kotlin.generators.tree.ListField as AbstractListField
|
||||
sealed class Field(
|
||||
override val name: String,
|
||||
override var isMutable: Boolean,
|
||||
) : AbstractField<Field>() {
|
||||
var baseDefaultValue: String? = null
|
||||
) : AbstractField<Field>(), AbstractFieldWithDefaultValue<Field> {
|
||||
var baseGetter: String? = null
|
||||
|
||||
sealed class UseFieldAsParameterInIrFactoryStrategy {
|
||||
@@ -32,11 +31,18 @@ sealed class Field(
|
||||
UseFieldAsParameterInIrFactoryStrategy.Yes(null)
|
||||
}
|
||||
|
||||
override val withGetter: Boolean
|
||||
override var withGetter: Boolean
|
||||
get() = baseGetter != null
|
||||
set(value) = error("Operation not supported")
|
||||
|
||||
override val defaultValueInImplementation: String?
|
||||
get() = baseGetter ?: baseDefaultValue
|
||||
override var defaultValueInImplementation: String? by ::baseGetter
|
||||
|
||||
override var defaultValueInBuilder: String?
|
||||
get() = null
|
||||
set(_) = error("Builders are not supported")
|
||||
|
||||
override val origin: Field
|
||||
get() = this
|
||||
|
||||
override var customSetter: String? = null
|
||||
|
||||
@@ -46,7 +52,7 @@ sealed class Field(
|
||||
get() = false
|
||||
|
||||
override val isFinal: Boolean
|
||||
get() = defaultValueInImplementation != null
|
||||
get() = baseGetter != null
|
||||
|
||||
override val isParameter: Boolean
|
||||
get() = false
|
||||
@@ -55,7 +61,6 @@ sealed class Field(
|
||||
|
||||
override fun updateFieldsInCopy(copy: Field) {
|
||||
super.updateFieldsInCopy(copy)
|
||||
copy.baseDefaultValue = baseDefaultValue
|
||||
copy.baseGetter = baseGetter
|
||||
copy.customUseInIrFactoryStrategy = customUseInIrFactoryStrategy
|
||||
copy.customSetter = customSetter
|
||||
|
||||
Reference in New Issue
Block a user