[IR] Unbind construction methods of IrVariableImpl from symbol.descriptor
This commit is contained in:
+3
-3
@@ -127,9 +127,9 @@ class LateinitUsageLowering(val backendContext: CommonBackendContext) : BodyLowe
|
|||||||
IrVariableSymbolImpl(descriptor),
|
IrVariableSymbolImpl(descriptor),
|
||||||
declaration.name,
|
declaration.name,
|
||||||
type,
|
type,
|
||||||
true,
|
isVar = true,
|
||||||
false,
|
isConst = false,
|
||||||
true
|
isLateinit = true
|
||||||
).also {
|
).also {
|
||||||
descriptor.bind(it)
|
descriptor.bind(it)
|
||||||
it.parent = declaration.parent
|
it.parent = declaration.parent
|
||||||
|
|||||||
+3
-3
@@ -58,9 +58,9 @@ class JsSharedVariablesManager(val builtIns: IrBuiltIns, val implicitDeclaration
|
|||||||
IrVariableSymbolImpl(descriptor),
|
IrVariableSymbolImpl(descriptor),
|
||||||
originalDeclaration.name,
|
originalDeclaration.name,
|
||||||
irCall.type,
|
irCall.type,
|
||||||
false,
|
isVar = false,
|
||||||
false,
|
isConst = false,
|
||||||
false
|
isLateinit = false
|
||||||
).also {
|
).also {
|
||||||
descriptor.bind(it)
|
descriptor.bind(it)
|
||||||
it.parent = originalDeclaration.parent
|
it.parent = originalDeclaration.parent
|
||||||
|
|||||||
+14
-21
@@ -29,18 +29,17 @@ import org.jetbrains.kotlin.ir.types.IrType
|
|||||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.utils.SmartList
|
|
||||||
|
|
||||||
class IrVariableImpl(
|
class IrVariableImpl(
|
||||||
override val startOffset: Int,
|
override val startOffset: Int,
|
||||||
override val endOffset: Int,
|
override val endOffset: Int,
|
||||||
override var origin: IrDeclarationOrigin,
|
override var origin: IrDeclarationOrigin,
|
||||||
override val symbol: IrVariableSymbol,
|
override val symbol: IrVariableSymbol,
|
||||||
override val name: Name = symbol.descriptor.name,
|
override val name: Name,
|
||||||
override val type: IrType,
|
override val type: IrType,
|
||||||
override val isVar: Boolean = symbol.descriptor.isVar,
|
override val isVar: Boolean,
|
||||||
override val isConst: Boolean = symbol.descriptor.isConst,
|
override val isConst: Boolean,
|
||||||
override val isLateinit: Boolean = symbol.descriptor.isLateInit
|
override val isLateinit: Boolean
|
||||||
) : IrVariable {
|
) : IrVariable {
|
||||||
|
|
||||||
private var _parent: IrDeclarationParent? = null
|
private var _parent: IrDeclarationParent? = null
|
||||||
@@ -54,27 +53,21 @@ class IrVariableImpl(
|
|||||||
override var annotations: List<IrConstructorCall> = emptyList()
|
override var annotations: List<IrConstructorCall> = emptyList()
|
||||||
override val metadata: MetadataSource? get() = null
|
override val metadata: MetadataSource? get() = null
|
||||||
|
|
||||||
constructor(
|
|
||||||
startOffset: Int,
|
|
||||||
endOffset: Int,
|
|
||||||
origin: IrDeclarationOrigin,
|
|
||||||
symbol: IrVariableSymbol,
|
|
||||||
type: IrType
|
|
||||||
) : this(
|
|
||||||
startOffset, endOffset, origin, symbol,
|
|
||||||
symbol.descriptor.name, type,
|
|
||||||
isVar = symbol.descriptor.isVar,
|
|
||||||
isConst = symbol.descriptor.isConst,
|
|
||||||
isLateinit = symbol.descriptor.isLateInit
|
|
||||||
)
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
startOffset: Int,
|
startOffset: Int,
|
||||||
endOffset: Int,
|
endOffset: Int,
|
||||||
origin: IrDeclarationOrigin,
|
origin: IrDeclarationOrigin,
|
||||||
descriptor: VariableDescriptor,
|
descriptor: VariableDescriptor,
|
||||||
type: IrType
|
type: IrType,
|
||||||
) : this(startOffset, endOffset, origin, IrVariableSymbolImpl(descriptor), type)
|
name: Name = descriptor.name,
|
||||||
|
symbol: IrVariableSymbol = IrVariableSymbolImpl(descriptor)
|
||||||
|
) : this(
|
||||||
|
startOffset, endOffset, origin,
|
||||||
|
symbol, name, type,
|
||||||
|
isVar = descriptor.isVar,
|
||||||
|
isConst = descriptor.isConst,
|
||||||
|
isLateinit = descriptor.isLateInit
|
||||||
|
)
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
startOffset: Int,
|
startOffset: Int,
|
||||||
|
|||||||
@@ -840,7 +840,7 @@ open class SymbolTable(
|
|||||||
descriptor: VariableDescriptor,
|
descriptor: VariableDescriptor,
|
||||||
type: IrType,
|
type: IrType,
|
||||||
variableFactory: (IrVariableSymbol) -> IrVariable = {
|
variableFactory: (IrVariableSymbol) -> IrVariable = {
|
||||||
IrVariableImpl(startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(descriptor), type)
|
IrVariableImpl(startOffset, endOffset, origin, descriptor, type, nameProvider.nameForDeclaration(descriptor), it)
|
||||||
}
|
}
|
||||||
|
|
||||||
): IrVariable =
|
): IrVariable =
|
||||||
|
|||||||
Reference in New Issue
Block a user