[IR] Mark IrFieldImpl with an opt-in annotation
KT-59318
This commit is contained in:
committed by
Space Team
parent
cd014c57a5
commit
e1d03f6540
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.ir.declarations.impl
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
|
import org.jetbrains.kotlin.descriptors.DescriptorVisibility
|
||||||
|
import org.jetbrains.kotlin.ir.IrImplementationDetail
|
||||||
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.expressions.IrConstructorCall
|
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||||
@@ -16,7 +17,7 @@ import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
|
|||||||
import org.jetbrains.kotlin.ir.types.IrType
|
import org.jetbrains.kotlin.ir.types.IrType
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
|
|
||||||
class IrFieldImpl(
|
class IrFieldImpl @IrImplementationDetail constructor(
|
||||||
override val startOffset: Int,
|
override val startOffset: Int,
|
||||||
override val endOffset: Int,
|
override val endOffset: Int,
|
||||||
override var origin: IrDeclarationOrigin,
|
override var origin: IrDeclarationOrigin,
|
||||||
|
|||||||
+5
-5
@@ -1129,16 +1129,16 @@ private class ObjCBlockPointerValuePassing(
|
|||||||
irClass.superTypes += stubs.irBuiltIns.anyType
|
irClass.superTypes += stubs.irBuiltIns.anyType
|
||||||
irClass.superTypes += functionType.makeNotNull()
|
irClass.superTypes += functionType.makeNotNull()
|
||||||
|
|
||||||
val blockHolderField = IrFieldImpl(
|
val blockHolderField = context.irFactory.createField(
|
||||||
startOffset, endOffset,
|
startOffset,
|
||||||
|
endOffset,
|
||||||
OBJC_BLOCK_FUNCTION_IMPL,
|
OBJC_BLOCK_FUNCTION_IMPL,
|
||||||
IrFieldSymbolImpl(),
|
|
||||||
Name.identifier("blockHolder"),
|
Name.identifier("blockHolder"),
|
||||||
stubs.irBuiltIns.anyType,
|
|
||||||
DescriptorVisibilities.PRIVATE,
|
DescriptorVisibilities.PRIVATE,
|
||||||
|
IrFieldSymbolImpl(),
|
||||||
|
stubs.irBuiltIns.anyType,
|
||||||
isFinal = true,
|
isFinal = true,
|
||||||
isStatic = false,
|
isStatic = false,
|
||||||
isExternal = false
|
|
||||||
)
|
)
|
||||||
irClass.addChild(blockHolderField)
|
irClass.addChild(blockHolderField)
|
||||||
|
|
||||||
|
|||||||
+3
-5
@@ -19,7 +19,6 @@ import org.jetbrains.kotlin.ir.IrStatement
|
|||||||
import org.jetbrains.kotlin.ir.builders.*
|
import org.jetbrains.kotlin.ir.builders.*
|
||||||
import org.jetbrains.kotlin.ir.builders.declarations.buildFun
|
import org.jetbrains.kotlin.ir.builders.declarations.buildFun
|
||||||
import org.jetbrains.kotlin.ir.declarations.*
|
import org.jetbrains.kotlin.ir.declarations.*
|
||||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl
|
|
||||||
import org.jetbrains.kotlin.ir.declarations.impl.IrPropertyImpl
|
import org.jetbrains.kotlin.ir.declarations.impl.IrPropertyImpl
|
||||||
import org.jetbrains.kotlin.ir.expressions.*
|
import org.jetbrains.kotlin.ir.expressions.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
|
import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl
|
||||||
@@ -381,16 +380,15 @@ private class InlineClassTransformer(private val context: Context) : IrBuildingT
|
|||||||
val startOffset = declaration.startOffset
|
val startOffset = declaration.startOffset
|
||||||
val endOffset = declaration.endOffset
|
val endOffset = declaration.endOffset
|
||||||
|
|
||||||
val irField = IrFieldImpl(
|
val irField = context.irFactory.createField(
|
||||||
startOffset,
|
startOffset,
|
||||||
endOffset,
|
endOffset,
|
||||||
IrDeclarationOrigin.DEFINED,
|
IrDeclarationOrigin.DEFINED,
|
||||||
IrFieldSymbolImpl(),
|
|
||||||
Name.identifier("value"),
|
Name.identifier("value"),
|
||||||
declaration.defaultType,
|
|
||||||
DescriptorVisibilities.PRIVATE,
|
DescriptorVisibilities.PRIVATE,
|
||||||
|
IrFieldSymbolImpl(),
|
||||||
|
declaration.defaultType,
|
||||||
isFinal = true,
|
isFinal = true,
|
||||||
isExternal = false,
|
|
||||||
isStatic = false,
|
isStatic = false,
|
||||||
)
|
)
|
||||||
irField.parent = declaration
|
irField.parent = declaration
|
||||||
|
|||||||
+5
-6
@@ -16,7 +16,6 @@ import org.jetbrains.kotlin.backend.konan.ir.buildSimpleAnnotation
|
|||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.*
|
||||||
import org.jetbrains.kotlin.ir.builders.*
|
import org.jetbrains.kotlin.ir.builders.*
|
||||||
import org.jetbrains.kotlin.ir.declarations.*
|
import org.jetbrains.kotlin.ir.declarations.*
|
||||||
import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl
|
|
||||||
import org.jetbrains.kotlin.ir.expressions.*
|
import org.jetbrains.kotlin.ir.expressions.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||||
import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl
|
import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl
|
||||||
@@ -70,15 +69,15 @@ internal class PropertyDelegationLowering(val generationState: NativeGenerationS
|
|||||||
val generatedClasses = mutableListOf<IrClass>()
|
val generatedClasses = mutableListOf<IrClass>()
|
||||||
|
|
||||||
fun kPropertyField(value: IrExpressionBody, id:Int) =
|
fun kPropertyField(value: IrExpressionBody, id:Int) =
|
||||||
IrFieldImpl(
|
context.irFactory.createField(
|
||||||
SYNTHETIC_OFFSET, SYNTHETIC_OFFSET,
|
SYNTHETIC_OFFSET,
|
||||||
|
SYNTHETIC_OFFSET,
|
||||||
DECLARATION_ORIGIN_KPROPERTIES_FOR_DELEGATION,
|
DECLARATION_ORIGIN_KPROPERTIES_FOR_DELEGATION,
|
||||||
IrFieldSymbolImpl(),
|
|
||||||
"KPROPERTY${id}".synthesizedName,
|
"KPROPERTY${id}".synthesizedName,
|
||||||
value.expression.type,
|
|
||||||
DescriptorVisibilities.PRIVATE,
|
DescriptorVisibilities.PRIVATE,
|
||||||
|
IrFieldSymbolImpl(),
|
||||||
|
value.expression.type,
|
||||||
isFinal = true,
|
isFinal = true,
|
||||||
isExternal = false,
|
|
||||||
isStatic = true,
|
isStatic = true,
|
||||||
).apply {
|
).apply {
|
||||||
parent = irFile
|
parent = irFile
|
||||||
|
|||||||
+5
-5
@@ -169,15 +169,15 @@ private class InteropLoweringPart1(val generationState: NativeGenerationState) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun IrFile.addTopLevelInitializer(expression: IrExpression, context: KonanBackendContext, threadLocal: Boolean, eager: Boolean) {
|
private fun IrFile.addTopLevelInitializer(expression: IrExpression, context: KonanBackendContext, threadLocal: Boolean, eager: Boolean) {
|
||||||
val irField = IrFieldImpl(
|
val irField = context.irFactory.createField(
|
||||||
expression.startOffset, expression.endOffset,
|
expression.startOffset,
|
||||||
|
expression.endOffset,
|
||||||
IrDeclarationOrigin.DEFINED,
|
IrDeclarationOrigin.DEFINED,
|
||||||
IrFieldSymbolImpl(),
|
|
||||||
"topLevelInitializer${topLevelInitializersCounter++}".synthesizedName,
|
"topLevelInitializer${topLevelInitializersCounter++}".synthesizedName,
|
||||||
expression.type,
|
|
||||||
DescriptorVisibilities.PRIVATE,
|
DescriptorVisibilities.PRIVATE,
|
||||||
|
IrFieldSymbolImpl(),
|
||||||
|
expression.type,
|
||||||
isFinal = true,
|
isFinal = true,
|
||||||
isExternal = false,
|
|
||||||
isStatic = true,
|
isStatic = true,
|
||||||
).apply {
|
).apply {
|
||||||
expression.setDeclarationsParent(this)
|
expression.setDeclarationsParent(this)
|
||||||
|
|||||||
Reference in New Issue
Block a user