[IR] Add a method to get ModuleDescriptor from IrPackageFragment
Ideally, instead of this method, there should be a link to IrModuleFragment. Unfortunately, it would require to big refactoring, as some of IrPackageFragment implementations doesn't have any IrModuleFragment inside, and are not located inside any IrModuleFragment. So for now, we just implement and use everywhere a single way of getting the module descriptor, which respects a IrModuleFragment link if it exists, and fallbacks to descriptor-based method if it doesn't. ^KT-62623
This commit is contained in:
committed by
Space Team
parent
9b9ddb760a
commit
ad5831acc6
+2
-2
@@ -181,14 +181,14 @@ abstract class KotlinIrLinker(
|
||||
override fun tryReferencingSimpleFunctionByLocalSignature(parent: IrDeclaration, idSignature: IdSignature): IrSimpleFunctionSymbol? {
|
||||
if (idSignature.isPubliclyVisible) return null
|
||||
val file = getFileOf(parent)
|
||||
val moduleDescriptor = file.packageFragmentDescriptor.containingDeclaration
|
||||
val moduleDescriptor = file.moduleDescriptor
|
||||
return resolveModuleDeserializer(moduleDescriptor, null).referenceSimpleFunctionByLocalSignature(file, idSignature)
|
||||
}
|
||||
|
||||
override fun tryReferencingPropertyByLocalSignature(parent: IrDeclaration, idSignature: IdSignature): IrPropertySymbol? {
|
||||
if (idSignature.isPubliclyVisible) return null
|
||||
val file = getFileOf(parent)
|
||||
val moduleDescriptor = file.packageFragmentDescriptor.containingDeclaration
|
||||
val moduleDescriptor = file.moduleDescriptor
|
||||
return resolveModuleDeserializer(moduleDescriptor, null).referencePropertyByLocalSignature(file, idSignature)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user