IR: refactor IdSignatureSerializer
Use a separate instance for each file.
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
||||
|
||||
class KonanGlobalDeclarationTable(signatureSerializer: IdSignatureSerializer, builtIns: IrBuiltIns) : GlobalDeclarationTable(signatureSerializer, KonanManglerIr) {
|
||||
class KonanGlobalDeclarationTable(builtIns: IrBuiltIns) : GlobalDeclarationTable(KonanManglerIr) {
|
||||
init {
|
||||
loadKnownBuiltins(builtIns)
|
||||
}
|
||||
|
||||
+1
-2
@@ -16,8 +16,7 @@ class KonanIrModuleSerializer(
|
||||
val skipExpects: Boolean
|
||||
) : IrModuleSerializer<KonanIrFileSerializer>(messageLogger) {
|
||||
|
||||
private val signaturer = IdSignatureSerializer(KonanManglerIr)
|
||||
private val globalDeclarationTable = KonanGlobalDeclarationTable(signaturer, irBuiltIns)
|
||||
private val globalDeclarationTable = KonanGlobalDeclarationTable(irBuiltIns)
|
||||
|
||||
// We skip files with IR for C structs and enums because they should be
|
||||
// generated anew.
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ internal class KonanIrLinker(
|
||||
override fun isBuiltInModule(moduleDescriptor: ModuleDescriptor): Boolean = moduleDescriptor.isNativeStdlib()
|
||||
|
||||
private val forwardDeclarationDeserializer = forwardModuleDescriptor?.let { KonanForwardDeclarationModuleDeserializer(it) }
|
||||
override val fakeOverrideBuilder = FakeOverrideBuilder(this, symbolTable, IdSignatureSerializer(KonanManglerIr), builtIns, KonanFakeOverrideClassFilter)
|
||||
override val fakeOverrideBuilder = FakeOverrideBuilder(this, symbolTable, KonanManglerIr, builtIns, KonanFakeOverrideClassFilter)
|
||||
|
||||
override fun createModuleDeserializer(moduleDescriptor: ModuleDescriptor, klib: IrLibrary?, strategy: DeserializationStrategy): IrModuleDeserializer {
|
||||
if (moduleDescriptor === forwardModuleDescriptor) {
|
||||
|
||||
Reference in New Issue
Block a user