[FIR] Give external package fragments different module descriptors.

The inliner uses module descriptors to figure out if it needs to
regenerate objects.

We should avoid the use of descriptors in the inliner, but this
works as a first quick fix.
This commit is contained in:
Mads Ager
2021-11-24 16:11:02 +01:00
committed by TeamCityServer
parent d205c376a7
commit 261482904c
6 changed files with 4 additions and 14 deletions
@@ -225,7 +225,10 @@ class Fir2IrDeclarationStorage(
fun getIrExternalPackageFragment(fqName: FqName): IrExternalPackageFragment {
return fragmentCache.getOrPut(fqName) {
return symbolTable.declareExternalPackageFragment(FirPackageFragmentDescriptor(fqName, moduleDescriptor))
// Make sure that external package fragments have a different module descriptor. The module descriptors are compared
// to determine if objects need regeneration because they are from different modules.
val externalFragmentModuleDescriptor = FirModuleDescriptor(session)
return symbolTable.declareExternalPackageFragment(FirPackageFragmentDescriptor(fqName, externalFragmentModuleDescriptor))
}
}
@@ -1,8 +1,3 @@
// With FIR the annotation implementation class is not regenerated as it
// is seen as coming from the same module.
// See IrSourceCompilerForInline.kt:isCallInsideSameModuleAsCallee.
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: assertion failed: assert(one.javaClass.getEnclosingClass().getName() == "test.C")
// TARGET_BACKEND: JVM_IR
// IGNORE_DEXING
// WITH_STDLIB
@@ -1,5 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: class should be regenerated, but test.AKt$sam$i$java_util_concurrent_Callable$0
// FULL_JDK
// WITH_STDLIB
@@ -1,5 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: class should be regenerated, but test.AKt$sam$i$java_util_concurrent_Callable$0
// FULL_JDK
// WITH_STDLIB
@@ -1,5 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: fail 1 : class test.AKt$test$1$1 == class test.AKt$test$1$1
// TARGET_BACKEND: JVM
// WITH_STDLIB
@@ -1,5 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// FIR status: fail 1 : class test.AKt$test$1$1 == class test.AKt$test$1$1
// TARGET_BACKEND: JVM
// WITH_STDLIB