[IR SERIALIZATION] Make [de]serialization processes incremental

- Use local uniqID local indexation file-local
 - Rethink the way declaration is looked for
 - Store in public file index only publicly accessible symbols
 - refactor API
 - code clean up
This commit is contained in:
Roman Artemev
2019-08-08 14:16:19 +03:00
committed by romanart
parent 96a2cc1f17
commit d50eb5ce52
7 changed files with 225 additions and 189 deletions
@@ -50,13 +50,5 @@ class JsIrLinker(
override fun readFileCount(moduleDescriptor: ModuleDescriptor) =
moduleDescriptor.kotlinLibrary.fileCount()
override fun List<IrFile>.handleClashes(uniqIdKey: UniqIdKey): IrFile {
if (size == 1)
return this[0]
assert(size != 0)
error("UniqId clash: ${uniqIdKey.uniqId.index}. Found in the " +
"[${this.joinToString { it.packageFragmentDescriptor.containingDeclaration.userName }}]")
}
private val ModuleDescriptor.userName get() = kotlinLibrary.libraryFile.absolutePath
}