IR: inline and remove ...FromLinker methods from SymbolTable
This commit is contained in:
committed by
TeamCityServer
parent
3a72c44184
commit
3f91674090
@@ -53,15 +53,6 @@ interface ReferenceSymbolTable {
|
|||||||
fun referenceTypeAlias(descriptor: TypeAliasDescriptor): IrTypeAliasSymbol
|
fun referenceTypeAlias(descriptor: TypeAliasDescriptor): IrTypeAliasSymbol
|
||||||
fun referenceTypeAlias(sig: IdSignature, reg: Boolean = true): IrTypeAliasSymbol
|
fun referenceTypeAlias(sig: IdSignature, reg: Boolean = true): IrTypeAliasSymbol
|
||||||
|
|
||||||
fun referenceClassFromLinker(sig: IdSignature) = referenceClass(sig, false)
|
|
||||||
fun referenceConstructorFromLinker(sig: IdSignature) = referenceConstructor(sig, false)
|
|
||||||
fun referenceEnumEntryFromLinker(sig: IdSignature) = referenceEnumEntry(sig, false)
|
|
||||||
fun referenceFieldFromLinker(sig: IdSignature) = referenceField(sig, false)
|
|
||||||
fun referencePropertyFromLinker(sig: IdSignature) = referenceProperty(sig, false)
|
|
||||||
fun referenceSimpleFunctionFromLinker(sig: IdSignature) = referenceSimpleFunction(sig, false)
|
|
||||||
fun referenceGlobalTypeParameterFromLinker(sig: IdSignature) = referenceTypeParameter(sig, false)
|
|
||||||
fun referenceTypeAliasFromLinker(sig: IdSignature) = referenceTypeAlias(sig, false)
|
|
||||||
|
|
||||||
fun enterScope(owner: IrSymbol)
|
fun enterScope(owner: IrSymbol)
|
||||||
fun enterScope(owner: IrDeclaration)
|
fun enterScope(owner: IrDeclaration)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -151,7 +151,7 @@ class FakeOverrideBuilder(
|
|||||||
private fun declareFunctionFakeOverride(declaration: IrFakeOverrideFunction, signature: IdSignature) {
|
private fun declareFunctionFakeOverride(declaration: IrFakeOverrideFunction, signature: IdSignature) {
|
||||||
val parent = declaration.parentAsClass
|
val parent = declaration.parentAsClass
|
||||||
val symbol = linker.tryReferencingSimpleFunctionByLocalSignature(parent, signature)
|
val symbol = linker.tryReferencingSimpleFunctionByLocalSignature(parent, signature)
|
||||||
?: symbolTable.referenceSimpleFunctionFromLinker(signature)
|
?: symbolTable.referenceSimpleFunction(signature, false)
|
||||||
symbolTable.declareSimpleFunction(signature, { symbol }) {
|
symbolTable.declareSimpleFunction(signature, { symbol }) {
|
||||||
assert(it === symbol)
|
assert(it === symbol)
|
||||||
declaration.acquireSymbol(it)
|
declaration.acquireSymbol(it)
|
||||||
@@ -161,7 +161,7 @@ class FakeOverrideBuilder(
|
|||||||
private fun declarePropertyFakeOverride(declaration: IrFakeOverrideProperty, signature: IdSignature) {
|
private fun declarePropertyFakeOverride(declaration: IrFakeOverrideProperty, signature: IdSignature) {
|
||||||
val parent = declaration.parentAsClass
|
val parent = declaration.parentAsClass
|
||||||
val symbol = linker.tryReferencingPropertyByLocalSignature(parent, signature)
|
val symbol = linker.tryReferencingPropertyByLocalSignature(parent, signature)
|
||||||
?: symbolTable.referencePropertyFromLinker(signature)
|
?: symbolTable.referenceProperty(signature, false)
|
||||||
symbolTable.declareProperty(signature, { symbol }) {
|
symbolTable.declareProperty(signature, { symbol }) {
|
||||||
assert(it === symbol)
|
assert(it === symbol)
|
||||||
declaration.acquireSymbol(it)
|
declaration.acquireSymbol(it)
|
||||||
|
|||||||
+9
-9
@@ -100,15 +100,15 @@ internal fun referenceDeserializedSymbol(
|
|||||||
): IrSymbol = symbolTable.run {
|
): IrSymbol = symbolTable.run {
|
||||||
when (symbolKind) {
|
when (symbolKind) {
|
||||||
BinarySymbolData.SymbolKind.ANONYMOUS_INIT_SYMBOL -> IrAnonymousInitializerSymbolImpl()
|
BinarySymbolData.SymbolKind.ANONYMOUS_INIT_SYMBOL -> IrAnonymousInitializerSymbolImpl()
|
||||||
BinarySymbolData.SymbolKind.CLASS_SYMBOL -> referenceClassFromLinker(idSig)
|
BinarySymbolData.SymbolKind.CLASS_SYMBOL -> referenceClass(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.CONSTRUCTOR_SYMBOL -> referenceConstructorFromLinker(idSig)
|
BinarySymbolData.SymbolKind.CONSTRUCTOR_SYMBOL -> referenceConstructor(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.TYPE_PARAMETER_SYMBOL -> referenceGlobalTypeParameterFromLinker(idSig)
|
BinarySymbolData.SymbolKind.TYPE_PARAMETER_SYMBOL -> referenceTypeParameter(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.ENUM_ENTRY_SYMBOL -> referenceEnumEntryFromLinker(idSig)
|
BinarySymbolData.SymbolKind.ENUM_ENTRY_SYMBOL -> referenceEnumEntry(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.STANDALONE_FIELD_SYMBOL -> referenceFieldFromLinker(idSig)
|
BinarySymbolData.SymbolKind.STANDALONE_FIELD_SYMBOL -> referenceField(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.FIELD_SYMBOL -> referenceFieldFromLinker(idSig)
|
BinarySymbolData.SymbolKind.FIELD_SYMBOL -> referenceField(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.FUNCTION_SYMBOL -> referenceSimpleFunctionFromLinker(idSig)
|
BinarySymbolData.SymbolKind.FUNCTION_SYMBOL -> referenceSimpleFunction(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.TYPEALIAS_SYMBOL -> referenceTypeAliasFromLinker(idSig)
|
BinarySymbolData.SymbolKind.TYPEALIAS_SYMBOL -> referenceTypeAlias(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> referencePropertyFromLinker(idSig)
|
BinarySymbolData.SymbolKind.PROPERTY_SYMBOL -> referenceProperty(idSig, false)
|
||||||
BinarySymbolData.SymbolKind.VARIABLE_SYMBOL -> IrVariableSymbolImpl()
|
BinarySymbolData.SymbolKind.VARIABLE_SYMBOL -> IrVariableSymbolImpl()
|
||||||
BinarySymbolData.SymbolKind.VALUE_PARAMETER_SYMBOL -> IrValueParameterSymbolImpl()
|
BinarySymbolData.SymbolKind.VALUE_PARAMETER_SYMBOL -> IrValueParameterSymbolImpl()
|
||||||
BinarySymbolData.SymbolKind.RECEIVER_PARAMETER_SYMBOL -> IrValueParameterSymbolImpl()
|
BinarySymbolData.SymbolKind.RECEIVER_PARAMETER_SYMBOL -> IrValueParameterSymbolImpl()
|
||||||
|
|||||||
+1
-1
@@ -890,7 +890,7 @@ internal class KonanIrLinker(
|
|||||||
if (actualModule !== moduleDescriptor) {
|
if (actualModule !== moduleDescriptor) {
|
||||||
val moduleDeserializer = resolveModuleDeserializer(actualModule, idSig)
|
val moduleDeserializer = resolveModuleDeserializer(actualModule, idSig)
|
||||||
moduleDeserializer.addModuleReachableTopLevel(idSig)
|
moduleDeserializer.addModuleReachableTopLevel(idSig)
|
||||||
return symbolTable.referenceClassFromLinker(idSig)
|
return symbolTable.referenceClass(idSig, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
return declaredDeclaration.getOrPut(idSig) { buildForwardDeclarationStub(descriptor) }.symbol
|
return declaredDeclaration.getOrPut(idSig) { buildForwardDeclarationStub(descriptor) }.symbol
|
||||||
|
|||||||
Reference in New Issue
Block a user