IR: move containerSource from descriptor to IrFunction, IrProperty
This commit is contained in:
+3
-1
@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
|
||||
internal class PersistentIrConstructor(
|
||||
override val startOffset: Int,
|
||||
@@ -39,7 +40,8 @@ internal class PersistentIrConstructor(
|
||||
override val isInline: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isPrimary: Boolean,
|
||||
override val isExpect: Boolean
|
||||
override val isExpect: Boolean,
|
||||
override val containerSource: DeserializedContainerSource?
|
||||
) : IrConstructor(),
|
||||
PersistentIrDeclarationBase<ConstructorCarrier>,
|
||||
ConstructorCarrier {
|
||||
|
||||
+8
-1
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.ir.expressions.persistent.PersistentIrExpressionBody
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
object PersistentIrFactory : IrFactory {
|
||||
@@ -63,9 +64,11 @@ object PersistentIrFactory : IrFactory {
|
||||
isExternal: Boolean,
|
||||
isPrimary: Boolean,
|
||||
isExpect: Boolean,
|
||||
containerSource: DeserializedContainerSource?,
|
||||
): IrConstructor =
|
||||
PersistentIrConstructor(
|
||||
startOffset, endOffset, origin, symbol, name, visibility, returnType, isInline, isExternal, isPrimary, isExpect
|
||||
startOffset, endOffset, origin, symbol, name, visibility, returnType, isInline, isExternal, isPrimary, isExpect,
|
||||
containerSource,
|
||||
)
|
||||
|
||||
override fun createEnumEntry(
|
||||
@@ -115,10 +118,12 @@ object PersistentIrFactory : IrFactory {
|
||||
isInfix: Boolean,
|
||||
isExpect: Boolean,
|
||||
isFakeOverride: Boolean,
|
||||
containerSource: DeserializedContainerSource?,
|
||||
): IrSimpleFunction =
|
||||
PersistentIrFunction(
|
||||
startOffset, endOffset, origin, symbol, name, visibility, modality, returnType,
|
||||
isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect, isFakeOverride,
|
||||
containerSource
|
||||
)
|
||||
|
||||
override fun createFakeOverrideFunction(
|
||||
@@ -170,10 +175,12 @@ object PersistentIrFactory : IrFactory {
|
||||
isExternal: Boolean,
|
||||
isExpect: Boolean,
|
||||
isFakeOverride: Boolean,
|
||||
containerSource: DeserializedContainerSource?,
|
||||
): IrProperty =
|
||||
PersistentIrProperty(
|
||||
startOffset, endOffset, origin, symbol, name, visibility, modality,
|
||||
isVar, isConst, isLateinit, isDelegated, isExternal, isExpect, isFakeOverride,
|
||||
containerSource
|
||||
)
|
||||
|
||||
override fun createFakeOverrideProperty(
|
||||
|
||||
+4
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
|
||||
internal abstract class PersistentIrFunctionCommon(
|
||||
override val startOffset: Int,
|
||||
@@ -34,6 +35,7 @@ internal abstract class PersistentIrFunctionCommon(
|
||||
override val isOperator: Boolean,
|
||||
override val isInfix: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
override val containerSource: DeserializedContainerSource? = null
|
||||
) : IrSimpleFunction(),
|
||||
PersistentIrDeclarationBase<FunctionCarrier>,
|
||||
FunctionCarrier {
|
||||
@@ -189,9 +191,11 @@ internal class PersistentIrFunction(
|
||||
isInfix: Boolean,
|
||||
isExpect: Boolean,
|
||||
override val isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
||||
containerSource: DeserializedContainerSource?
|
||||
) : PersistentIrFunctionCommon(
|
||||
startOffset, endOffset, origin, name, visibility, returnType, isInline,
|
||||
isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect,
|
||||
containerSource
|
||||
) {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: FunctionDescriptor
|
||||
|
||||
+6
-1
@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.ir.descriptors.WrappedPropertyDescriptor
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
|
||||
internal abstract class PersistentIrPropertyCommon(
|
||||
override val startOffset: Int,
|
||||
@@ -40,6 +41,7 @@ internal abstract class PersistentIrPropertyCommon(
|
||||
override val isDelegated: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
override val containerSource: DeserializedContainerSource?,
|
||||
) : IrProperty(),
|
||||
PersistentIrDeclarationBase<PropertyCarrier>,
|
||||
PropertyCarrier {
|
||||
@@ -110,8 +112,10 @@ internal class PersistentIrProperty(
|
||||
isExternal: Boolean,
|
||||
isExpect: Boolean = false,
|
||||
override val isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
||||
containerSource: DeserializedContainerSource?,
|
||||
) : PersistentIrPropertyCommon(
|
||||
startOffset, endOffset, origin, name, visibility, isVar, isConst, isLateinit, isDelegated, isExternal, isExpect,
|
||||
containerSource,
|
||||
) {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
@@ -137,7 +141,8 @@ internal class PersistentIrFakeOverrideProperty(
|
||||
isExpect: Boolean,
|
||||
) : PersistentIrPropertyCommon(
|
||||
startOffset, endOffset, origin, name, visibility, isVar, isConst, isLateinit,
|
||||
isDelegated, isExternal, isExpect
|
||||
isDelegated, isExternal, isExpect,
|
||||
containerSource = null,
|
||||
), IrFakeOverrideProperty {
|
||||
override val isFakeOverride: Boolean
|
||||
get() = true
|
||||
|
||||
Reference in New Issue
Block a user