IR: remove deprecated constructor of IrConstructorImpl
This commit is contained in:
+7
-9
@@ -251,15 +251,13 @@ class FunctionGenerator(declarationGenerator: DeclarationGenerator) : Declaratio
|
|||||||
val startOffset = ktConstructorElement.getStartOffsetOfConstructorDeclarationKeywordOrNull() ?: ktConstructorElement.pureStartOffset
|
val startOffset = ktConstructorElement.getStartOffsetOfConstructorDeclarationKeywordOrNull() ?: ktConstructorElement.pureStartOffset
|
||||||
val endOffset = ktConstructorElement.pureEndOffset
|
val endOffset = ktConstructorElement.pureEndOffset
|
||||||
val origin = IrDeclarationOrigin.DEFINED
|
val origin = IrDeclarationOrigin.DEFINED
|
||||||
return context.symbolTable.declareConstructor(
|
return context.symbolTable.declareConstructor(constructorDescriptor) {
|
||||||
constructorDescriptor
|
with(constructorDescriptor) {
|
||||||
) {
|
IrConstructorImpl(
|
||||||
IrConstructorImpl(
|
startOffset, endOffset, origin, it, context.symbolTable.nameProvider.nameForDeclaration(this),
|
||||||
startOffset, endOffset, origin, it,
|
visibility, IrUninitializedType, isInline, isEffectivelyExternal(), isPrimary, isExpect
|
||||||
returnType = IrUninitializedType,
|
)
|
||||||
descriptor = constructorDescriptor,
|
}.apply {
|
||||||
name = context.symbolTable.nameProvider.nameForDeclaration(constructorDescriptor),
|
|
||||||
).apply {
|
|
||||||
metadata = MetadataSource.Function(it.descriptor)
|
metadata = MetadataSource.Function(it.descriptor)
|
||||||
}
|
}
|
||||||
}.buildWithScope { irConstructor ->
|
}.buildWithScope { irConstructor ->
|
||||||
|
|||||||
+6
-1
@@ -155,7 +155,12 @@ class StandaloneDeclarationGenerator(private val context: GeneratorContext) {
|
|||||||
startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassConstructorDescriptor, symbol: IrConstructorSymbol,
|
startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassConstructorDescriptor, symbol: IrConstructorSymbol,
|
||||||
defaultArgumentFactory: IrFunction.(IrValueParameter) -> IrExpressionBody? = { null }
|
defaultArgumentFactory: IrFunction.(IrValueParameter) -> IrExpressionBody? = { null }
|
||||||
): IrConstructor {
|
): IrConstructor {
|
||||||
val irConstructor = IrConstructorImpl(startOffset, endOffset, origin, symbol, IrUninitializedType, descriptor)
|
val irConstructor = with(descriptor) {
|
||||||
|
IrConstructorImpl(
|
||||||
|
startOffset, endOffset, origin, symbol, name, visibility, IrUninitializedType, isInline,
|
||||||
|
isEffectivelyExternal(), isPrimary, isExpect
|
||||||
|
)
|
||||||
|
}
|
||||||
irConstructor.metadata = MetadataSource.Function(descriptor)
|
irConstructor.metadata = MetadataSource.Function(descriptor)
|
||||||
|
|
||||||
symbolTable.withScope(irConstructor) {
|
symbolTable.withScope(irConstructor) {
|
||||||
|
|||||||
+2
-20
@@ -19,13 +19,13 @@ package org.jetbrains.kotlin.ir.declarations.impl
|
|||||||
import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
|
import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.Visibility
|
import org.jetbrains.kotlin.descriptors.Visibility
|
||||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||||
import org.jetbrains.kotlin.ir.declarations.*
|
import org.jetbrains.kotlin.ir.declarations.IrConstructor
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||||
import org.jetbrains.kotlin.ir.declarations.impl.carriers.ConstructorCarrier
|
import org.jetbrains.kotlin.ir.declarations.impl.carriers.ConstructorCarrier
|
||||||
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
|
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
|
||||||
import org.jetbrains.kotlin.ir.types.IrType
|
import org.jetbrains.kotlin.ir.types.IrType
|
||||||
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.resolve.descriptorUtil.isEffectivelyExternal
|
|
||||||
|
|
||||||
class IrConstructorImpl(
|
class IrConstructorImpl(
|
||||||
startOffset: Int,
|
startOffset: Int,
|
||||||
@@ -49,24 +49,6 @@ class IrConstructorImpl(
|
|||||||
IrConstructor,
|
IrConstructor,
|
||||||
ConstructorCarrier {
|
ConstructorCarrier {
|
||||||
|
|
||||||
constructor(
|
|
||||||
startOffset: Int,
|
|
||||||
endOffset: Int,
|
|
||||||
origin: IrDeclarationOrigin,
|
|
||||||
symbol: IrConstructorSymbol,
|
|
||||||
returnType: IrType,
|
|
||||||
descriptor: ClassConstructorDescriptor,
|
|
||||||
name: Name = descriptor.name
|
|
||||||
) : this(
|
|
||||||
startOffset, endOffset, origin, symbol,
|
|
||||||
name = name, visibility = descriptor.visibility,
|
|
||||||
returnType = returnType,
|
|
||||||
isInline = descriptor.isInline,
|
|
||||||
isExternal = descriptor.isEffectivelyExternal(),
|
|
||||||
isPrimary = descriptor.isPrimary,
|
|
||||||
isExpect = descriptor.isExpect
|
|
||||||
)
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
symbol.bind(this)
|
symbol.bind(this)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user