[IR] Mark IrExpressionBodyImpl with an opt-in annotation
KT-59318
This commit is contained in:
committed by
Space Team
parent
2096d22e18
commit
1b557c1657
+1
-2
@@ -16,7 +16,6 @@ import org.jetbrains.kotlin.ir.backend.js.utils.isObjectInstanceGetter
|
|||||||
import org.jetbrains.kotlin.ir.backend.js.utils.primaryConstructorReplacement
|
import org.jetbrains.kotlin.ir.backend.js.utils.primaryConstructorReplacement
|
||||||
import org.jetbrains.kotlin.ir.declarations.*
|
import org.jetbrains.kotlin.ir.declarations.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.*
|
import org.jetbrains.kotlin.ir.expressions.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl
|
|
||||||
import org.jetbrains.kotlin.ir.types.classOrNull
|
import org.jetbrains.kotlin.ir.types.classOrNull
|
||||||
import org.jetbrains.kotlin.ir.util.*
|
import org.jetbrains.kotlin.ir.util.*
|
||||||
|
|
||||||
@@ -64,7 +63,7 @@ class PurifyObjectInstanceGettersLowering(val context: JsCommonBackendContext) :
|
|||||||
val objectToCreate = type.classOrNull?.owner ?: return null
|
val objectToCreate = type.classOrNull?.owner ?: return null
|
||||||
|
|
||||||
if (objectToCreate.isPureObject()) {
|
if (objectToCreate.isPureObject()) {
|
||||||
initializer = IrExpressionBodyImpl(
|
initializer = context.irFactory.createExpressionBody(
|
||||||
objectToCreate.primaryConstructor?.let { JsIrBuilder.buildConstructorCall(it.symbol) }
|
objectToCreate.primaryConstructor?.let { JsIrBuilder.buildConstructorCall(it.symbol) }
|
||||||
?: objectToCreate.primaryConstructorReplacement?.let { JsIrBuilder.buildCall(it.symbol) }
|
?: objectToCreate.primaryConstructorReplacement?.let { JsIrBuilder.buildCall(it.symbol) }
|
||||||
?: error("Object should contain a primary constructor")
|
?: error("Object should contain a primary constructor")
|
||||||
|
|||||||
+3
-2
@@ -26,7 +26,6 @@ import org.jetbrains.kotlin.ir.builders.declarations.addValueParameter
|
|||||||
import org.jetbrains.kotlin.ir.builders.declarations.buildConstructor
|
import org.jetbrains.kotlin.ir.builders.declarations.buildConstructor
|
||||||
import org.jetbrains.kotlin.ir.declarations.*
|
import org.jetbrains.kotlin.ir.declarations.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.*
|
import org.jetbrains.kotlin.ir.expressions.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl
|
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrSetValueImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrSetValueImpl
|
||||||
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
|
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
|
||||||
@@ -143,7 +142,9 @@ private class EnumClassLowering(private val context: JvmBackendContext) : ClassL
|
|||||||
|
|
||||||
private fun buildEnumEntryField(enumEntry: IrEnumEntry): IrField =
|
private fun buildEnumEntryField(enumEntry: IrEnumEntry): IrField =
|
||||||
context.cachedDeclarations.getFieldForEnumEntry(enumEntry).apply {
|
context.cachedDeclarations.getFieldForEnumEntry(enumEntry).apply {
|
||||||
initializer = enumEntry.initializerExpression?.let { IrExpressionBodyImpl(it.expression.patchDeclarationParents(this)) }
|
initializer = enumEntry.initializerExpression?.let {
|
||||||
|
context.irFactory.createExpressionBody(it.expression.patchDeclarationParents(this))
|
||||||
|
}
|
||||||
annotations = annotations + enumEntry.annotations
|
annotations = annotations + enumEntry.annotations
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-9
@@ -214,22 +214,24 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran
|
|||||||
// Bridge from static to static method - simply fill the function arguments to the parameters.
|
// Bridge from static to static method - simply fill the function arguments to the parameters.
|
||||||
// By nature of the generation of both source and target of bridge, they line up.
|
// By nature of the generation of both source and target of bridge, they line up.
|
||||||
private fun IrFunction.bridgeToStatic(callTarget: IrSimpleFunction) {
|
private fun IrFunction.bridgeToStatic(callTarget: IrSimpleFunction) {
|
||||||
body = IrExpressionBodyImpl(IrCallImpl.fromSymbolOwner(startOffset, endOffset, returnType, callTarget.symbol).also { call ->
|
body = context.irFactory.createExpressionBody(
|
||||||
|
IrCallImpl.fromSymbolOwner(startOffset, endOffset, returnType, callTarget.symbol).also { call ->
|
||||||
|
|
||||||
callTarget.typeParameters.forEachIndexed { i, _ ->
|
callTarget.typeParameters.forEachIndexed { i, _ ->
|
||||||
call.putTypeArgument(i, createPlaceholderAnyNType(context.irBuiltIns))
|
call.putTypeArgument(i, createPlaceholderAnyNType(context.irBuiltIns))
|
||||||
}
|
}
|
||||||
|
|
||||||
valueParameters.forEachIndexed { i, it ->
|
valueParameters.forEachIndexed { i, it ->
|
||||||
call.putValueArgument(i, IrGetValueImpl(startOffset, endOffset, it.symbol))
|
call.putValueArgument(i, IrGetValueImpl(startOffset, endOffset, it.symbol))
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bridge from static DefaultImpl method to the interface method. Arguments need to
|
// Bridge from static DefaultImpl method to the interface method. Arguments need to
|
||||||
// be shifted in presence of dispatch and extension receiver.
|
// be shifted in presence of dispatch and extension receiver.
|
||||||
private fun IrFunction.bridgeViaAccessorTo(callTarget: IrSimpleFunction) {
|
private fun IrFunction.bridgeViaAccessorTo(callTarget: IrSimpleFunction) {
|
||||||
body = IrExpressionBodyImpl(
|
body = context.irFactory.createExpressionBody(
|
||||||
IrCallImpl.fromSymbolOwner(
|
IrCallImpl.fromSymbolOwner(
|
||||||
startOffset,
|
startOffset,
|
||||||
endOffset,
|
endOffset,
|
||||||
|
|||||||
+1
-1
@@ -108,7 +108,7 @@ private class JvmOverloadsAnnotationLowering(val context: JvmBackendContext) : C
|
|||||||
wrapperIrFunction.body = if (target is IrConstructor) {
|
wrapperIrFunction.body = if (target is IrConstructor) {
|
||||||
context.irFactory.createBlockBody(UNDEFINED_OFFSET, UNDEFINED_OFFSET, listOf(call))
|
context.irFactory.createBlockBody(UNDEFINED_OFFSET, UNDEFINED_OFFSET, listOf(call))
|
||||||
} else {
|
} else {
|
||||||
IrExpressionBodyImpl(
|
context.irFactory.createExpressionBody(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, call
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET, call
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -17,7 +17,6 @@ import org.jetbrains.kotlin.ir.builders.declarations.addField
|
|||||||
import org.jetbrains.kotlin.ir.builders.irCall
|
import org.jetbrains.kotlin.ir.builders.irCall
|
||||||
import org.jetbrains.kotlin.ir.declarations.*
|
import org.jetbrains.kotlin.ir.declarations.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.*
|
import org.jetbrains.kotlin.ir.expressions.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl
|
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrGetFieldImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrGetFieldImpl
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrSetFieldImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrSetFieldImpl
|
||||||
import org.jetbrains.kotlin.ir.symbols.impl.IrAnonymousInitializerSymbolImpl
|
import org.jetbrains.kotlin.ir.symbols.impl.IrAnonymousInitializerSymbolImpl
|
||||||
@@ -114,7 +113,7 @@ private class MoveOrCopyCompanionObjectFieldsLowering(val context: JvmBackendCon
|
|||||||
parent = newParent
|
parent = newParent
|
||||||
correspondingPropertySymbol = oldProperty.symbol
|
correspondingPropertySymbol = oldProperty.symbol
|
||||||
initializer = oldField.initializer?.run {
|
initializer = oldField.initializer?.run {
|
||||||
IrExpressionBodyImpl(startOffset, endOffset, (expression as IrConst<*>).shallowCopy())
|
context.irFactory.createExpressionBody(startOffset, endOffset, (expression as IrConst<*>).shallowCopy())
|
||||||
}
|
}
|
||||||
annotations += oldField.annotations
|
annotations += oldField.annotations
|
||||||
if (oldProperty.parentAsClass.visibility == DescriptorVisibilities.PRIVATE) {
|
if (oldProperty.parentAsClass.visibility == DescriptorVisibilities.PRIVATE) {
|
||||||
|
|||||||
+5
-1
@@ -94,7 +94,11 @@ internal abstract class SuspendLoweringUtils(protected val context: JvmBackendCo
|
|||||||
val message = "This is a stub representing a copy of a suspend method without the state machine " +
|
val message = "This is a stub representing a copy of a suspend method without the state machine " +
|
||||||
"(used by the inliner). Since the difference is at the bytecode level, the body is " +
|
"(used by the inliner). Since the difference is at the bytecode level, the body is " +
|
||||||
"still on the original function. Use suspendForInlineToOriginal() to retrieve it."
|
"still on the original function. Use suspendForInlineToOriginal() to retrieve it."
|
||||||
body = IrExpressionBodyImpl(startOffset, endOffset, IrErrorExpressionImpl(startOffset, endOffset, returnType, message))
|
body = context.irFactory.createExpressionBody(
|
||||||
|
startOffset,
|
||||||
|
endOffset,
|
||||||
|
IrErrorExpressionImpl(startOffset, endOffset, returnType, message),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun IrFunction.addCompletionValueParameter(): IrValueParameter =
|
protected fun IrFunction.addCompletionValueParameter(): IrValueParameter =
|
||||||
|
|||||||
+4
-4
@@ -172,7 +172,7 @@ class CachedSyntheticDeclarations(private val context: JvmBackendContext) {
|
|||||||
JvmLoweredDeclarationOrigin.SYNTHETIC_MARKER_PARAMETER
|
JvmLoweredDeclarationOrigin.SYNTHETIC_MARKER_PARAMETER
|
||||||
)
|
)
|
||||||
|
|
||||||
accessor.body = IrExpressionBodyImpl(
|
accessor.body = context.irFactory.createExpressionBody(
|
||||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
|
||||||
createConstructorCall(accessor, source.symbol)
|
createConstructorCall(accessor, source.symbol)
|
||||||
)
|
)
|
||||||
@@ -208,7 +208,7 @@ class CachedSyntheticDeclarations(private val context: JvmBackendContext) {
|
|||||||
accessor.copyValueParametersToStatic(source, JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR, dispatchReceiverType)
|
accessor.copyValueParametersToStatic(source, JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR, dispatchReceiverType)
|
||||||
accessor.returnType = source.returnType.remapTypeParameters(source, accessor)
|
accessor.returnType = source.returnType.remapTypeParameters(source, accessor)
|
||||||
|
|
||||||
accessor.body = IrExpressionBodyImpl(
|
accessor.body = context.irFactory.createExpressionBody(
|
||||||
accessor.startOffset, accessor.startOffset,
|
accessor.startOffset, accessor.startOffset,
|
||||||
createSimpleFunctionCall(accessor, source.symbol, superQualifierSymbol)
|
createSimpleFunctionCall(accessor, source.symbol, superQualifierSymbol)
|
||||||
)
|
)
|
||||||
@@ -270,7 +270,7 @@ class CachedSyntheticDeclarations(private val context: JvmBackendContext) {
|
|||||||
val maybeDispatchReceiver =
|
val maybeDispatchReceiver =
|
||||||
if (targetField.isStatic) null
|
if (targetField.isStatic) null
|
||||||
else IrGetValueImpl(accessor.startOffset, accessor.endOffset, accessor.valueParameters[0].symbol)
|
else IrGetValueImpl(accessor.startOffset, accessor.endOffset, accessor.valueParameters[0].symbol)
|
||||||
return IrExpressionBodyImpl(
|
return context.irFactory.createExpressionBody(
|
||||||
accessor.startOffset, accessor.endOffset,
|
accessor.startOffset, accessor.endOffset,
|
||||||
IrGetFieldImpl(
|
IrGetFieldImpl(
|
||||||
accessor.startOffset, accessor.endOffset,
|
accessor.startOffset, accessor.endOffset,
|
||||||
@@ -332,7 +332,7 @@ class CachedSyntheticDeclarations(private val context: JvmBackendContext) {
|
|||||||
accessor.startOffset, accessor.endOffset,
|
accessor.startOffset, accessor.endOffset,
|
||||||
accessor.valueParameters[if (targetField.isStatic) 0 else 1].symbol
|
accessor.valueParameters[if (targetField.isStatic) 0 else 1].symbol
|
||||||
)
|
)
|
||||||
return IrExpressionBodyImpl(
|
return context.irFactory.createExpressionBody(
|
||||||
accessor.startOffset, accessor.endOffset,
|
accessor.startOffset, accessor.endOffset,
|
||||||
IrSetFieldImpl(
|
IrSetFieldImpl(
|
||||||
accessor.startOffset, accessor.endOffset,
|
accessor.startOffset, accessor.endOffset,
|
||||||
|
|||||||
+2
-3
@@ -16,19 +16,18 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.ir.expressions.impl
|
package org.jetbrains.kotlin.ir.expressions.impl
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.ir.IrImplementationDetail
|
||||||
import org.jetbrains.kotlin.ir.declarations.IrFactory
|
import org.jetbrains.kotlin.ir.declarations.IrFactory
|
||||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
|
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
||||||
|
|
||||||
class IrExpressionBodyImpl(
|
class IrExpressionBodyImpl @IrImplementationDetail constructor(
|
||||||
override val startOffset: Int,
|
override val startOffset: Int,
|
||||||
override val endOffset: Int,
|
override val endOffset: Int,
|
||||||
override var expression: IrExpression,
|
override var expression: IrExpression,
|
||||||
) : IrExpressionBody() {
|
) : IrExpressionBody() {
|
||||||
|
|
||||||
constructor(expression: IrExpression) : this(expression.startOffset, expression.endOffset, expression)
|
|
||||||
|
|
||||||
override val factory: IrFactory
|
override val factory: IrFactory
|
||||||
get() = IrFactoryImpl
|
get() = IrFactoryImpl
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-9
@@ -129,15 +129,17 @@ internal class CEnumClassGenerator(
|
|||||||
)
|
)
|
||||||
val constructorSymbol = symbolTable.descriptorExtension.referenceConstructor(enumDescriptor.unsubstitutedPrimaryConstructor!!)
|
val constructorSymbol = symbolTable.descriptorExtension.referenceConstructor(enumDescriptor.unsubstitutedPrimaryConstructor!!)
|
||||||
postLinkageSteps.add {
|
postLinkageSteps.add {
|
||||||
enumEntry.initializerExpression = IrExpressionBodyImpl(IrEnumConstructorCallImpl(
|
enumEntry.initializerExpression = context.irFactory.createExpressionBody(
|
||||||
SYNTHETIC_OFFSET, SYNTHETIC_OFFSET,
|
IrEnumConstructorCallImpl(
|
||||||
type = irBuiltIns.unitType,
|
SYNTHETIC_OFFSET, SYNTHETIC_OFFSET,
|
||||||
symbol = constructorSymbol,
|
type = irBuiltIns.unitType,
|
||||||
typeArgumentsCount = 0,
|
symbol = constructorSymbol,
|
||||||
valueArgumentsCount = constructorSymbol.owner.valueParameters.size
|
typeArgumentsCount = 0,
|
||||||
).also {
|
valueArgumentsCount = constructorSymbol.owner.valueParameters.size,
|
||||||
it.putValueArgument(0, extractEnumEntryValue(entryDescriptor))
|
).also {
|
||||||
})
|
it.putValueArgument(0, extractEnumEntryValue(entryDescriptor))
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return enumEntry
|
return enumEntry
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -14,8 +14,8 @@ import org.jetbrains.kotlin.descriptors.MemberDescriptor
|
|||||||
import org.jetbrains.kotlin.ir.IrElement
|
import org.jetbrains.kotlin.ir.IrElement
|
||||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||||
import org.jetbrains.kotlin.ir.declarations.*
|
import org.jetbrains.kotlin.ir.declarations.*
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.impl.IrFactoryImpl
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl
|
|
||||||
import org.jetbrains.kotlin.ir.symbols.*
|
import org.jetbrains.kotlin.ir.symbols.*
|
||||||
import org.jetbrains.kotlin.ir.util.*
|
import org.jetbrains.kotlin.ir.util.*
|
||||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
|
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
|
||||||
@@ -83,7 +83,7 @@ internal class ExpectToActualDefaultValueCopier(private val irModule: IrModuleFr
|
|||||||
|
|
||||||
val actualForExpected = function.findActualForExpected()
|
val actualForExpected = function.findActualForExpected()
|
||||||
actualForExpected.valueParameters[index].defaultValue =
|
actualForExpected.valueParameters[index].defaultValue =
|
||||||
IrExpressionBodyImpl(
|
irModule.irBuiltins.irFactory.createExpressionBody(
|
||||||
defaultValue.startOffset, defaultValue.endOffset,
|
defaultValue.startOffset, defaultValue.endOffset,
|
||||||
defaultValue.expression.remapExpectValueSymbols().patchDeclarationParents(actualForExpected)
|
defaultValue.expression.remapExpectValueSymbols().patchDeclarationParents(actualForExpected)
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -81,7 +81,7 @@ internal class InitializersLowering(val context: CommonBackendContext) : ClassLo
|
|||||||
// We shall keep initializer for constants for compile-time instantiation.
|
// We shall keep initializer for constants for compile-time instantiation.
|
||||||
// We suppose that if the property is const, then its initializer is IrConst.
|
// We suppose that if the property is const, then its initializer is IrConst.
|
||||||
// If this requirement isn't satisfied, then PropertyAccessorInlineLowering can fail.
|
// If this requirement isn't satisfied, then PropertyAccessorInlineLowering can fail.
|
||||||
declaration.initializer = if (isConst) IrExpressionBodyImpl(initExpression.shallowCopy()) else null
|
declaration.initializer = if (isConst) context.irFactory.createExpressionBody(initExpression.shallowCopy()) else null
|
||||||
|
|
||||||
return declaration
|
return declaration
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -186,7 +186,7 @@ private class InteropLoweringPart1(val generationState: NativeGenerationState) :
|
|||||||
if (eager)
|
if (eager)
|
||||||
annotations += buildSimpleAnnotation(context.irBuiltIns, startOffset, endOffset, context.ir.symbols.eagerInitialization.owner)
|
annotations += buildSimpleAnnotation(context.irBuiltIns, startOffset, endOffset, context.ir.symbols.eagerInitialization.owner)
|
||||||
|
|
||||||
initializer = IrExpressionBodyImpl(startOffset, endOffset, expression)
|
initializer = context.irFactory.createExpressionBody(startOffset, endOffset, expression)
|
||||||
}
|
}
|
||||||
addChild(irField)
|
addChild(irField)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -617,7 +617,7 @@ internal class TestProcessor (val context: Context) {
|
|||||||
annotations += buildSimpleAnnotation(context.irBuiltIns, startOffset, endOffset, context.ir.symbols.eagerInitialization.owner)
|
annotations += buildSimpleAnnotation(context.irBuiltIns, startOffset, endOffset, context.ir.symbols.eagerInitialization.owner)
|
||||||
annotations += buildSimpleAnnotation(context.irBuiltIns, startOffset, endOffset, context.ir.symbols.threadLocal.owner)
|
annotations += buildSimpleAnnotation(context.irBuiltIns, startOffset, endOffset, context.ir.symbols.threadLocal.owner)
|
||||||
statements.forEach { it.accept(SetDeclarationsParentVisitor, this) }
|
statements.forEach { it.accept(SetDeclarationsParentVisitor, this) }
|
||||||
initializer = IrExpressionBodyImpl(SYNTHETIC_OFFSET, SYNTHETIC_OFFSET,
|
initializer = context.irFactory.createExpressionBody(SYNTHETIC_OFFSET, SYNTHETIC_OFFSET,
|
||||||
IrCompositeImpl(SYNTHETIC_OFFSET, SYNTHETIC_OFFSET, context.irBuiltIns.unitType, null, statements)
|
IrCompositeImpl(SYNTHETIC_OFFSET, SYNTHETIC_OFFSET, context.irBuiltIns.unitType, null, statements)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -81,7 +81,7 @@ abstract class AbstractAtomicfuIrBuilder(
|
|||||||
visibility = DescriptorVisibilities.PRIVATE
|
visibility = DescriptorVisibilities.PRIVATE
|
||||||
origin = AbstractAtomicSymbols.ATOMICFU_GENERATED_FIELD
|
origin = AbstractAtomicSymbols.ATOMICFU_GENERATED_FIELD
|
||||||
}.apply {
|
}.apply {
|
||||||
initializer = initValue?.let { IrExpressionBodyImpl(it) }
|
initializer = initValue?.let(context.irFactory::createExpressionBody)
|
||||||
this.annotations = annotations + atomicSymbols.volatileAnnotationConstructorCall
|
this.annotations = annotations + atomicSymbols.volatileAnnotationConstructorCall
|
||||||
this.parent = parentContainer
|
this.parent = parentContainer
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ abstract class AbstractAtomicfuIrBuilder(
|
|||||||
visibility = DescriptorVisibilities.PRIVATE
|
visibility = DescriptorVisibilities.PRIVATE
|
||||||
origin = AbstractAtomicSymbols.ATOMICFU_GENERATED_FIELD
|
origin = AbstractAtomicSymbols.ATOMICFU_GENERATED_FIELD
|
||||||
}.apply {
|
}.apply {
|
||||||
this.initializer = IrExpressionBodyImpl(
|
this.initializer = context.irFactory.createExpressionBody(
|
||||||
newAtomicArray(arrayClass, size, dispatchReceiver)
|
newAtomicArray(arrayClass, size, dispatchReceiver)
|
||||||
)
|
)
|
||||||
this.annotations = annotations
|
this.annotations = annotations
|
||||||
@@ -150,7 +150,7 @@ abstract class AbstractAtomicfuIrBuilder(
|
|||||||
this.visibility = DescriptorVisibilities.PRIVATE
|
this.visibility = DescriptorVisibilities.PRIVATE
|
||||||
origin = AbstractAtomicSymbols.ATOMICFU_GENERATED_FIELD
|
origin = AbstractAtomicSymbols.ATOMICFU_GENERATED_FIELD
|
||||||
}.apply {
|
}.apply {
|
||||||
initializer = IrExpressionBodyImpl(
|
initializer = context.irFactory.createExpressionBody(
|
||||||
IrConstructorCallImpl.fromSymbolOwner(
|
IrConstructorCallImpl.fromSymbolOwner(
|
||||||
irClass.defaultType,
|
irClass.defaultType,
|
||||||
irClass.primaryConstructor!!.symbol
|
irClass.primaryConstructor!!.symbol
|
||||||
|
|||||||
+1
-1
@@ -180,7 +180,7 @@ interface IrBuilderWithPluginContext {
|
|||||||
field.startOffset,
|
field.startOffset,
|
||||||
field.endOffset
|
field.endOffset
|
||||||
)
|
)
|
||||||
field.initializer = IrExpressionBodyImpl(builder.initializer())
|
field.initializer = factory.createExpressionBody(builder.initializer())
|
||||||
field.annotations += createAnnotationCallWithoutArgs(compilerContext.jvmFieldClassSymbol)
|
field.annotations += createAnnotationCallWithoutArgs(compilerContext.jvmFieldClassSymbol)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user