Split up IR header onto separate tables

This commit is contained in:
Igor Chevdar
2019-06-06 12:33:53 +03:00
parent da11ab8ce3
commit ee42b35581
2 changed files with 10 additions and 3 deletions
@@ -106,9 +106,7 @@ internal fun produceOutput(context: Context) {
context.config.includeBinaries,
neededLibraries,
context.serializedMetadata!!,
// During serializer and library commonizations we've got duplicate SerializedIr in
// two different packages. TODO: Eliminate them eventually.
SerializedIr(context.serializedIr!!.module, context.serializedIr!!.combinedDeclarationFilePath),
context.serializedIr!!,
versions,
target,
output,
@@ -42,6 +42,15 @@ class KonanIrLinker(
override fun reader(moduleDescriptor: ModuleDescriptor, uniqId: UniqId) =
moduleDescriptor.konanLibrary!!.irDeclaration(uniqId.index, uniqId.isLocal)
override fun readSymbol(moduleDescriptor: ModuleDescriptor, symbolIndex: Int) =
moduleDescriptor.konanLibrary!!.symbol(symbolIndex)
override fun readType(moduleDescriptor: ModuleDescriptor, typeIndex: Int) =
moduleDescriptor.konanLibrary!!.type(typeIndex)
override fun readString(moduleDescriptor: ModuleDescriptor, stringIndex: Int) =
moduleDescriptor.konanLibrary!!.string(stringIndex)
override val ModuleDescriptor.irHeader get() = this.konanLibrary!!.irHeader
val modules: Map<String, IrModuleFragment> get() = mutableMapOf<String, IrModuleFragment>().apply {