[JS IR] IrFactory which saves signatures for declarations created in BE
This commit is contained in:
committed by
TeamCityServer
parent
4e0d91d463
commit
56e1c4e38f
+2
-4
@@ -31,15 +31,13 @@ class IrAnonymousInitializerImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrAnonymousInitializerSymbol,
|
||||
override val isStatic: Boolean = false
|
||||
override val isStatic: Boolean = false,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrAnonymousInitializer() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
+2
-4
@@ -41,15 +41,13 @@ open class IrClassImpl(
|
||||
override val isInline: Boolean = false,
|
||||
override val isExpect: Boolean = false,
|
||||
override val isFun: Boolean = false,
|
||||
override val source: SourceElement = SourceElement.NO_SOURCE
|
||||
override val source: SourceElement = SourceElement.NO_SOURCE,
|
||||
override val factory: IrFactory = IrFactoryImpl
|
||||
) : IrClass() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
+1
-3
@@ -42,14 +42,12 @@ class IrConstructorImpl(
|
||||
override val isPrimary: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
override val containerSource: DeserializedContainerSource? = null,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrConstructor() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
+2
-4
@@ -29,15 +29,13 @@ class IrEnumEntryImpl(
|
||||
override val endOffset: Int,
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrEnumEntrySymbol,
|
||||
override val name: Name
|
||||
override val name: Name,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrEnumEntry() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
+2
-4
@@ -29,16 +29,14 @@ import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
class IrErrorDeclarationImpl(
|
||||
override val startOffset: Int,
|
||||
override val endOffset: Int,
|
||||
private val _descriptor: DeclarationDescriptor?
|
||||
private val _descriptor: DeclarationDescriptor?,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrErrorDeclaration() {
|
||||
override val descriptor: DeclarationDescriptor
|
||||
get() = _descriptor ?: this.toIrBasedDescriptor()
|
||||
|
||||
override var origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
}
|
||||
|
||||
+20
-13
@@ -19,8 +19,11 @@ import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
object IrFactoryImpl : IrFactory {
|
||||
object IrFactoryImpl : AbstractIrFactoryImpl() {
|
||||
override val stageController: StageController = StageController()
|
||||
}
|
||||
|
||||
abstract class AbstractIrFactoryImpl : IrFactory {
|
||||
|
||||
override fun createAnonymousInitializer(
|
||||
startOffset: Int,
|
||||
@@ -29,7 +32,7 @@ object IrFactoryImpl : IrFactory {
|
||||
symbol: IrAnonymousInitializerSymbol,
|
||||
isStatic: Boolean,
|
||||
): IrAnonymousInitializer =
|
||||
IrAnonymousInitializerImpl(startOffset, endOffset, origin, symbol, isStatic)
|
||||
IrAnonymousInitializerImpl(startOffset, endOffset, origin, symbol, isStatic, factory = this)
|
||||
|
||||
override fun createClass(
|
||||
startOffset: Int,
|
||||
@@ -52,6 +55,7 @@ object IrFactoryImpl : IrFactory {
|
||||
IrClassImpl(
|
||||
startOffset, endOffset, origin, symbol, name, kind, visibility, modality,
|
||||
isCompanion, isInner, isData, isExternal, isInline, isExpect, isFun, source,
|
||||
factory = this
|
||||
)
|
||||
|
||||
override fun createConstructor(
|
||||
@@ -70,7 +74,7 @@ object IrFactoryImpl : IrFactory {
|
||||
): IrConstructor =
|
||||
IrConstructorImpl(
|
||||
startOffset, endOffset, origin, symbol, name, visibility, returnType, isInline, isExternal, isPrimary, isExpect,
|
||||
containerSource,
|
||||
containerSource, factory = this
|
||||
)
|
||||
|
||||
override fun createEnumEntry(
|
||||
@@ -80,14 +84,14 @@ object IrFactoryImpl : IrFactory {
|
||||
symbol: IrEnumEntrySymbol,
|
||||
name: Name,
|
||||
): IrEnumEntry =
|
||||
IrEnumEntryImpl(startOffset, endOffset, origin, symbol, name)
|
||||
IrEnumEntryImpl(startOffset, endOffset, origin, symbol, name, factory = this)
|
||||
|
||||
override fun createErrorDeclaration(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
descriptor: DeclarationDescriptor?,
|
||||
): IrErrorDeclaration =
|
||||
IrErrorDeclarationImpl(startOffset, endOffset, descriptor)
|
||||
IrErrorDeclarationImpl(startOffset, endOffset, descriptor, factory = this)
|
||||
|
||||
override fun createField(
|
||||
startOffset: Int,
|
||||
@@ -101,7 +105,7 @@ object IrFactoryImpl : IrFactory {
|
||||
isExternal: Boolean,
|
||||
isStatic: Boolean,
|
||||
): IrField =
|
||||
IrFieldImpl(startOffset, endOffset, origin, symbol, name, type, visibility, isFinal, isExternal, isStatic)
|
||||
IrFieldImpl(startOffset, endOffset, origin, symbol, name, type, visibility, isFinal, isExternal, isStatic, factory = this)
|
||||
|
||||
override fun createFunction(
|
||||
startOffset: Int,
|
||||
@@ -125,7 +129,7 @@ object IrFactoryImpl : IrFactory {
|
||||
IrFunctionImpl(
|
||||
startOffset, endOffset, origin, symbol, name, visibility, modality, returnType,
|
||||
isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect, isFakeOverride,
|
||||
containerSource
|
||||
containerSource, factory = this
|
||||
)
|
||||
|
||||
override fun createFakeOverrideFunction(
|
||||
@@ -147,6 +151,7 @@ object IrFactoryImpl : IrFactory {
|
||||
IrFakeOverrideFunctionImpl(
|
||||
startOffset, endOffset, origin, name, visibility, modality, returnType,
|
||||
isInline, isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect,
|
||||
factory = this
|
||||
)
|
||||
|
||||
override fun createLocalDelegatedProperty(
|
||||
@@ -158,7 +163,7 @@ object IrFactoryImpl : IrFactory {
|
||||
type: IrType,
|
||||
isVar: Boolean,
|
||||
): IrLocalDelegatedProperty =
|
||||
IrLocalDelegatedPropertyImpl(startOffset, endOffset, origin, symbol, name, type, isVar)
|
||||
IrLocalDelegatedPropertyImpl(startOffset, endOffset, origin, symbol, name, type, isVar, factory = this)
|
||||
|
||||
override fun createProperty(
|
||||
startOffset: Int,
|
||||
@@ -180,7 +185,7 @@ object IrFactoryImpl : IrFactory {
|
||||
IrPropertyImpl(
|
||||
startOffset, endOffset, origin, symbol, name, visibility, modality,
|
||||
isVar, isConst, isLateinit, isDelegated, isExternal, isExpect, isFakeOverride,
|
||||
containerSource,
|
||||
containerSource, factory = this
|
||||
)
|
||||
|
||||
override fun createFakeOverrideProperty(
|
||||
@@ -200,6 +205,7 @@ object IrFactoryImpl : IrFactory {
|
||||
IrFakeOverridePropertyImpl(
|
||||
startOffset, endOffset, origin, name, visibility, modality,
|
||||
isVar, isConst, isLateinit, isDelegated, isExternal, isExpect,
|
||||
factory = this
|
||||
)
|
||||
|
||||
override fun createTypeAlias(
|
||||
@@ -212,7 +218,7 @@ object IrFactoryImpl : IrFactory {
|
||||
isActual: Boolean,
|
||||
origin: IrDeclarationOrigin,
|
||||
): IrTypeAlias =
|
||||
IrTypeAliasImpl(startOffset, endOffset, symbol, name, visibility, expandedType, isActual, origin)
|
||||
IrTypeAliasImpl(startOffset, endOffset, symbol, name, visibility, expandedType, isActual, origin, factory = this)
|
||||
|
||||
override fun createTypeParameter(
|
||||
startOffset: Int,
|
||||
@@ -224,7 +230,7 @@ object IrFactoryImpl : IrFactory {
|
||||
isReified: Boolean,
|
||||
variance: Variance,
|
||||
): IrTypeParameter =
|
||||
IrTypeParameterImpl(startOffset, endOffset, origin, symbol, name, index, isReified, variance)
|
||||
IrTypeParameterImpl(startOffset, endOffset, origin, symbol, name, index, isReified, variance, factory = this)
|
||||
|
||||
override fun createValueParameter(
|
||||
startOffset: Int,
|
||||
@@ -241,7 +247,8 @@ object IrFactoryImpl : IrFactory {
|
||||
isAssignable: Boolean,
|
||||
): IrValueParameter =
|
||||
IrValueParameterImpl(
|
||||
startOffset, endOffset, origin, symbol, name, index, type, varargElementType, isCrossinline, isNoinline, isHidden, isAssignable
|
||||
startOffset, endOffset, origin, symbol, name, index, type, varargElementType,
|
||||
isCrossinline, isNoinline, isHidden, isAssignable, factory = this
|
||||
)
|
||||
|
||||
override fun createExpressionBody(
|
||||
@@ -282,4 +289,4 @@ object IrFactoryImpl : IrFactory {
|
||||
initializer: IrBlockBody.() -> Unit,
|
||||
): IrBlockBody =
|
||||
IrBlockBodyImpl(startOffset, endOffset, initializer)
|
||||
}
|
||||
}
|
||||
+395
@@ -0,0 +1,395 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.ir.declarations.impl
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
class IrFactoryImplForJsIC(override val stageController: StageController) : AbstractIrFactoryImpl(), IdSignatureRetriever {
|
||||
private val declarationToSignature = mutableMapOf<IrDeclaration, IdSignature>()
|
||||
|
||||
private fun <T : IrDeclaration> T.register(): T {
|
||||
val parentSig = stageController.currentDeclaration?.let { declarationSignature(it) } ?: return this
|
||||
|
||||
stageController.createSignature(parentSig)?.let { declarationToSignature[this] = it}
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
override fun declarationSignature(declaration: IrDeclaration): IdSignature? {
|
||||
return declarationToSignature[declaration] ?: declaration.symbol.signature
|
||||
}
|
||||
|
||||
override fun createAnonymousInitializer(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrAnonymousInitializerSymbol,
|
||||
isStatic: Boolean
|
||||
): IrAnonymousInitializer {
|
||||
return super.createAnonymousInitializer(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
isStatic,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createClass(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrClassSymbol,
|
||||
name: Name,
|
||||
kind: ClassKind,
|
||||
visibility: DescriptorVisibility,
|
||||
modality: Modality,
|
||||
isCompanion: Boolean,
|
||||
isInner: Boolean,
|
||||
isData: Boolean,
|
||||
isExternal: Boolean,
|
||||
isInline: Boolean,
|
||||
isExpect: Boolean,
|
||||
isFun: Boolean,
|
||||
source: SourceElement
|
||||
): IrClass {
|
||||
return super.createClass(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
kind,
|
||||
visibility,
|
||||
modality,
|
||||
isCompanion,
|
||||
isInner,
|
||||
isData,
|
||||
isExternal,
|
||||
isInline,
|
||||
isExpect,
|
||||
isFun,
|
||||
source,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createConstructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrConstructorSymbol,
|
||||
name: Name,
|
||||
visibility: DescriptorVisibility,
|
||||
returnType: IrType,
|
||||
isInline: Boolean,
|
||||
isExternal: Boolean,
|
||||
isPrimary: Boolean,
|
||||
isExpect: Boolean,
|
||||
containerSource: DeserializedContainerSource?
|
||||
): IrConstructor {
|
||||
return super.createConstructor(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
visibility,
|
||||
returnType,
|
||||
isInline,
|
||||
isExternal,
|
||||
isPrimary,
|
||||
isExpect,
|
||||
containerSource,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createEnumEntry(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrEnumEntrySymbol,
|
||||
name: Name
|
||||
): IrEnumEntry {
|
||||
return super.createEnumEntry(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createErrorDeclaration(startOffset: Int, endOffset: Int, descriptor: DeclarationDescriptor?): IrErrorDeclaration {
|
||||
return super.createErrorDeclaration(startOffset, endOffset, descriptor)
|
||||
}
|
||||
|
||||
override fun createField(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrFieldSymbol,
|
||||
name: Name,
|
||||
type: IrType,
|
||||
visibility: DescriptorVisibility,
|
||||
isFinal: Boolean,
|
||||
isExternal: Boolean,
|
||||
isStatic: Boolean
|
||||
): IrField {
|
||||
return super.createField(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
type,
|
||||
visibility,
|
||||
isFinal,
|
||||
isExternal,
|
||||
isStatic,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createFunction(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrSimpleFunctionSymbol,
|
||||
name: Name,
|
||||
visibility: DescriptorVisibility,
|
||||
modality: Modality,
|
||||
returnType: IrType,
|
||||
isInline: Boolean,
|
||||
isExternal: Boolean,
|
||||
isTailrec: Boolean,
|
||||
isSuspend: Boolean,
|
||||
isOperator: Boolean,
|
||||
isInfix: Boolean,
|
||||
isExpect: Boolean,
|
||||
isFakeOverride: Boolean,
|
||||
containerSource: DeserializedContainerSource?
|
||||
): IrSimpleFunction {
|
||||
return super.createFunction(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
visibility,
|
||||
modality,
|
||||
returnType,
|
||||
isInline,
|
||||
isExternal,
|
||||
isTailrec,
|
||||
isSuspend,
|
||||
isOperator,
|
||||
isInfix,
|
||||
isExpect,
|
||||
isFakeOverride,
|
||||
containerSource,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createFakeOverrideFunction(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
name: Name,
|
||||
visibility: DescriptorVisibility,
|
||||
modality: Modality,
|
||||
returnType: IrType,
|
||||
isInline: Boolean,
|
||||
isExternal: Boolean,
|
||||
isTailrec: Boolean,
|
||||
isSuspend: Boolean,
|
||||
isOperator: Boolean,
|
||||
isInfix: Boolean,
|
||||
isExpect: Boolean
|
||||
): IrSimpleFunction {
|
||||
return super.createFakeOverrideFunction(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
name,
|
||||
visibility,
|
||||
modality,
|
||||
returnType,
|
||||
isInline,
|
||||
isExternal,
|
||||
isTailrec,
|
||||
isSuspend,
|
||||
isOperator,
|
||||
isInfix,
|
||||
isExpect,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createLocalDelegatedProperty(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrLocalDelegatedPropertySymbol,
|
||||
name: Name,
|
||||
type: IrType,
|
||||
isVar: Boolean
|
||||
): IrLocalDelegatedProperty {
|
||||
return super.createLocalDelegatedProperty(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
type,
|
||||
isVar,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createProperty(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrPropertySymbol,
|
||||
name: Name,
|
||||
visibility: DescriptorVisibility,
|
||||
modality: Modality,
|
||||
isVar: Boolean,
|
||||
isConst: Boolean,
|
||||
isLateinit: Boolean,
|
||||
isDelegated: Boolean,
|
||||
isExternal: Boolean,
|
||||
isExpect: Boolean,
|
||||
isFakeOverride: Boolean,
|
||||
containerSource: DeserializedContainerSource?
|
||||
): IrProperty {
|
||||
return super.createProperty(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
visibility,
|
||||
modality,
|
||||
isVar,
|
||||
isConst,
|
||||
isLateinit,
|
||||
isDelegated,
|
||||
isExternal,
|
||||
isExpect,
|
||||
isFakeOverride,
|
||||
containerSource,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createFakeOverrideProperty(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
name: Name,
|
||||
visibility: DescriptorVisibility,
|
||||
modality: Modality,
|
||||
isVar: Boolean,
|
||||
isConst: Boolean,
|
||||
isLateinit: Boolean,
|
||||
isDelegated: Boolean,
|
||||
isExternal: Boolean,
|
||||
isExpect: Boolean
|
||||
): IrProperty {
|
||||
return super.createFakeOverrideProperty(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
name,
|
||||
visibility,
|
||||
modality,
|
||||
isVar,
|
||||
isConst,
|
||||
isLateinit,
|
||||
isDelegated,
|
||||
isExternal,
|
||||
isExpect,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createTypeAlias(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
symbol: IrTypeAliasSymbol,
|
||||
name: Name,
|
||||
visibility: DescriptorVisibility,
|
||||
expandedType: IrType,
|
||||
isActual: Boolean,
|
||||
origin: IrDeclarationOrigin
|
||||
): IrTypeAlias {
|
||||
return super.createTypeAlias(
|
||||
startOffset,
|
||||
endOffset,
|
||||
symbol,
|
||||
name,
|
||||
visibility,
|
||||
expandedType,
|
||||
isActual,
|
||||
origin,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createTypeParameter(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrTypeParameterSymbol,
|
||||
name: Name,
|
||||
index: Int,
|
||||
isReified: Boolean,
|
||||
variance: Variance
|
||||
): IrTypeParameter {
|
||||
return super.createTypeParameter(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
index,
|
||||
isReified,
|
||||
variance,
|
||||
).register()
|
||||
}
|
||||
|
||||
override fun createValueParameter(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrValueParameterSymbol,
|
||||
name: Name,
|
||||
index: Int,
|
||||
type: IrType,
|
||||
varargElementType: IrType?,
|
||||
isCrossinline: Boolean,
|
||||
isNoinline: Boolean,
|
||||
isHidden: Boolean,
|
||||
isAssignable: Boolean
|
||||
): IrValueParameter {
|
||||
return super.createValueParameter(
|
||||
startOffset,
|
||||
endOffset,
|
||||
origin,
|
||||
symbol,
|
||||
name,
|
||||
index,
|
||||
type,
|
||||
varargElementType,
|
||||
isCrossinline,
|
||||
isNoinline,
|
||||
isHidden,
|
||||
isAssignable,
|
||||
).register()
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -38,14 +38,12 @@ class IrFieldImpl(
|
||||
override val isFinal: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isStatic: Boolean,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrField() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
+2
-2
@@ -37,8 +37,6 @@ abstract class IrFunctionCommonImpl(
|
||||
override val isExpect: Boolean,
|
||||
override val containerSource: DeserializedContainerSource?,
|
||||
) : IrSimpleFunction() {
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
@@ -86,6 +84,7 @@ class IrFunctionImpl(
|
||||
isExpect: Boolean,
|
||||
override val isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
||||
containerSource: DeserializedContainerSource? = null,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrFunctionCommonImpl(
|
||||
startOffset, endOffset, origin, name, visibility, returnType, isInline,
|
||||
isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect,
|
||||
@@ -115,6 +114,7 @@ class IrFakeOverrideFunctionImpl(
|
||||
isOperator: Boolean,
|
||||
isInfix: Boolean,
|
||||
isExpect: Boolean,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrFunctionCommonImpl(
|
||||
startOffset, endOffset, origin, name, visibility, returnType, isInline,
|
||||
isExternal, isTailrec, isSuspend, isOperator, isInfix, isExpect,
|
||||
|
||||
+2
-4
@@ -20,15 +20,13 @@ class IrLocalDelegatedPropertyImpl(
|
||||
override val symbol: IrLocalDelegatedPropertySymbol,
|
||||
override val name: Name,
|
||||
override var type: IrType,
|
||||
override val isVar: Boolean
|
||||
override val isVar: Boolean,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrLocalDelegatedProperty() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
+2
-2
@@ -42,8 +42,6 @@ abstract class IrPropertyCommonImpl(
|
||||
override val isExpect: Boolean,
|
||||
override val containerSource: DeserializedContainerSource?,
|
||||
) : IrProperty() {
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
@@ -77,6 +75,7 @@ class IrPropertyImpl(
|
||||
isExpect: Boolean = false,
|
||||
override val isFakeOverride: Boolean = origin == IrDeclarationOrigin.FAKE_OVERRIDE,
|
||||
containerSource: DeserializedContainerSource? = null,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrPropertyCommonImpl(
|
||||
startOffset, endOffset, origin, name, visibility, isVar, isConst, isLateinit, isDelegated, isExternal, isExpect,
|
||||
containerSource
|
||||
@@ -103,6 +102,7 @@ class IrFakeOverridePropertyImpl(
|
||||
isDelegated: Boolean,
|
||||
isExternal: Boolean,
|
||||
isExpect: Boolean,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrPropertyCommonImpl(
|
||||
startOffset, endOffset, origin, name, visibility, isVar, isConst, isLateinit, isDelegated, isExternal, isExpect,
|
||||
containerSource = null,
|
||||
|
||||
+2
-4
@@ -22,15 +22,13 @@ class IrTypeAliasImpl(
|
||||
override var visibility: DescriptorVisibility,
|
||||
override var expandedType: IrType,
|
||||
override val isActual: Boolean,
|
||||
override var origin: IrDeclarationOrigin
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrTypeAlias() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
+2
-4
@@ -36,15 +36,13 @@ class IrTypeParameterImpl(
|
||||
override val name: Name,
|
||||
override val index: Int,
|
||||
override val isReified: Boolean,
|
||||
override val variance: Variance
|
||||
override val variance: Variance,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrTypeParameter() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
+2
-4
@@ -40,7 +40,8 @@ class IrValueParameterImpl(
|
||||
override val isCrossinline: Boolean,
|
||||
override val isNoinline: Boolean,
|
||||
override val isHidden: Boolean,
|
||||
override val isAssignable: Boolean
|
||||
override val isAssignable: Boolean,
|
||||
override val factory: IrFactory = IrFactoryImpl,
|
||||
) : IrValueParameter() {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ParameterDescriptor
|
||||
@@ -50,9 +51,6 @@ class IrValueParameterImpl(
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
override lateinit var parent: IrDeclarationParent
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
|
||||
|
||||
@@ -34,4 +34,8 @@ open class StageController(open val currentStage: Int = 0) {
|
||||
open fun createSignature(parentSignature: IdSignature): IdSignature? = null
|
||||
|
||||
open val currentDeclaration: IrDeclaration? get() = null
|
||||
}
|
||||
|
||||
interface IdSignatureRetriever {
|
||||
fun declarationSignature(declaration: IrDeclaration): IdSignature?
|
||||
}
|
||||
Reference in New Issue
Block a user