IR: remove deprecated constructors of IrVariableImpl
This commit is contained in:
@@ -81,13 +81,10 @@ class Scope(val scopeOwnerSymbol: IrSymbol) {
|
|||||||
endOffset: Int = UNDEFINED_OFFSET
|
endOffset: Int = UNDEFINED_OFFSET
|
||||||
): IrVariable {
|
): IrVariable {
|
||||||
val originalKotlinType = type ?: irType.toKotlinType()
|
val originalKotlinType = type ?: irType.toKotlinType()
|
||||||
|
val descriptor = createDescriptorForTemporaryVariable(originalKotlinType, nameHint, isMutable)
|
||||||
return IrVariableImpl(
|
return IrVariableImpl(
|
||||||
startOffset, endOffset, origin,
|
startOffset, endOffset, origin, IrVariableSymbolImpl(descriptor), descriptor.name,
|
||||||
createDescriptorForTemporaryVariable(
|
irType, isMutable, isConst = false, isLateinit = false
|
||||||
originalKotlinType,
|
|
||||||
nameHint, isMutable
|
|
||||||
),
|
|
||||||
irType
|
|
||||||
).apply {
|
).apply {
|
||||||
parent = getLocalDeclarationParent()
|
parent = getLocalDeclarationParent()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-29
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.ir.declarations.MetadataSource
|
|||||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||||
import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol
|
import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol
|
||||||
import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl
|
|
||||||
import org.jetbrains.kotlin.ir.types.IrType
|
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
|
||||||
@@ -54,33 +53,6 @@ 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,
|
|
||||||
descriptor: VariableDescriptor,
|
|
||||||
type: IrType,
|
|
||||||
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(
|
|
||||||
startOffset: Int,
|
|
||||||
endOffset: Int,
|
|
||||||
origin: IrDeclarationOrigin,
|
|
||||||
descriptor: VariableDescriptor,
|
|
||||||
type: IrType,
|
|
||||||
initializer: IrExpression?
|
|
||||||
) : this(startOffset, endOffset, origin, descriptor, type) {
|
|
||||||
this.initializer = initializer
|
|
||||||
}
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
symbol.bind(this)
|
symbol.bind(this)
|
||||||
}
|
}
|
||||||
@@ -100,4 +72,4 @@ class IrVariableImpl(
|
|||||||
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
|
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
|
||||||
initializer = initializer?.transform(transformer, data)
|
initializer = initializer?.transform(transformer, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -927,9 +927,11 @@ open class SymbolTable(
|
|||||||
descriptor: VariableDescriptor,
|
descriptor: VariableDescriptor,
|
||||||
type: IrType,
|
type: IrType,
|
||||||
variableFactory: (IrVariableSymbol) -> IrVariable = {
|
variableFactory: (IrVariableSymbol) -> IrVariable = {
|
||||||
IrVariableImpl(startOffset, endOffset, origin, descriptor, type, nameProvider.nameForDeclaration(descriptor), it)
|
IrVariableImpl(
|
||||||
|
startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(descriptor), type,
|
||||||
|
descriptor.isVar, descriptor.isConst, descriptor.isLateInit
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
): IrVariable =
|
): IrVariable =
|
||||||
variableSymbolTable.declareLocal(
|
variableSymbolTable.declareLocal(
|
||||||
descriptor,
|
descriptor,
|
||||||
|
|||||||
Reference in New Issue
Block a user