[IR] Linker: Small improvements
This commit is contained in:
+5
-15
@@ -113,31 +113,21 @@ abstract class KotlinIrLinker(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun findDeserializedDeclarationForSymbol(symbol: IrSymbol): DeclarationDescriptor? {
|
private fun findDeserializedDeclarationForSymbol(symbol: IrSymbol): DeclarationDescriptor? {
|
||||||
|
if (!triedToDeserializeDeclarationForSymbol.add(symbol)) return null
|
||||||
if (symbol in triedToDeserializeDeclarationForSymbol) {
|
val descriptor = if (symbol.hasDescriptor) symbol.descriptor else return null
|
||||||
return null
|
|
||||||
}
|
|
||||||
triedToDeserializeDeclarationForSymbol.add(symbol)
|
|
||||||
|
|
||||||
if (!symbol.hasDescriptor) return null
|
|
||||||
val descriptor = symbol.descriptor
|
|
||||||
|
|
||||||
val moduleDeserializer = resolveModuleDeserializer(descriptor.module, symbol.signature)
|
val moduleDeserializer = resolveModuleDeserializer(descriptor.module, symbol.signature)
|
||||||
|
|
||||||
moduleDeserializer.declareIrSymbol(symbol)
|
moduleDeserializer.declareIrSymbol(symbol)
|
||||||
|
|
||||||
deserializeAllReachableTopLevels()
|
deserializeAllReachableTopLevels()
|
||||||
if (!symbol.isBound) return null
|
|
||||||
return descriptor
|
return if (symbol.isBound) descriptor else null
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun platformSpecificSymbol(symbol: IrSymbol): Boolean = false
|
protected open fun platformSpecificSymbol(symbol: IrSymbol): Boolean = false
|
||||||
|
|
||||||
private fun tryResolveCustomDeclaration(symbol: IrSymbol): IrDeclaration? {
|
private fun tryResolveCustomDeclaration(symbol: IrSymbol): IrDeclaration? {
|
||||||
if (!symbol.hasDescriptor) return null
|
val descriptor = if (symbol.hasDescriptor) symbol.descriptor else return null
|
||||||
|
|
||||||
val descriptor = symbol.descriptor
|
|
||||||
|
|
||||||
if (descriptor is CallableMemberDescriptor) {
|
if (descriptor is CallableMemberDescriptor) {
|
||||||
if (descriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {
|
if (descriptor.kind == CallableMemberDescriptor.Kind.FAKE_OVERRIDE) {
|
||||||
// skip fake overrides
|
// skip fake overrides
|
||||||
|
|||||||
Reference in New Issue
Block a user