[IR SERIALIZATION] Do not track non-metadata descriptors in descriptor table
This commit is contained in:
@@ -296,7 +296,8 @@ fun serializeModuleIntoKlib(
|
||||
) {
|
||||
val descriptorTable = DescriptorTable()
|
||||
|
||||
val serializedIr = JsIrModuleSerializer(emptyLoggingContext, moduleFragment.irBuiltins, descriptorTable).serializedIrModule(moduleFragment)
|
||||
val serializedIr =
|
||||
JsIrModuleSerializer(emptyLoggingContext, moduleFragment.irBuiltins, descriptorTable).serializedIrModule(moduleFragment)
|
||||
val serializer = JsKlibMetadataSerializationUtil
|
||||
|
||||
val moduleDescription =
|
||||
@@ -307,8 +308,8 @@ fun serializeModuleIntoKlib(
|
||||
languageVersionSettings,
|
||||
metadataVersion
|
||||
) { declarationDescriptor ->
|
||||
val index = descriptorTable.get(declarationDescriptor)
|
||||
index?.let { newJsDescriptorUniqId(it) }
|
||||
val index = descriptorTable.get(declarationDescriptor) ?: error("No descriptor ID found for $declarationDescriptor")
|
||||
newJsDescriptorUniqId(index)
|
||||
}
|
||||
|
||||
val abiVersion = KotlinAbiVersion.CURRENT
|
||||
|
||||
-7
@@ -31,8 +31,6 @@ class JsKlibMetadataSerializerExtension(
|
||||
}
|
||||
|
||||
private fun uniqId(descriptor: DeclarationDescriptor): JsKlibMetadataProtoBuf.DescriptorUniqId? {
|
||||
// val index = declarationTable.descriptorTable.get(descriptor)
|
||||
// return index?.let { newDescriptorUniqId(it) }
|
||||
return declarationTableHandler(descriptor)
|
||||
}
|
||||
|
||||
@@ -46,11 +44,6 @@ class JsKlibMetadataSerializerExtension(
|
||||
super.serializeTypeAlias(typeAlias, proto)
|
||||
}
|
||||
|
||||
override fun serializeValueParameter(descriptor: ValueParameterDescriptor, proto: ProtoBuf.ValueParameter.Builder) {
|
||||
uniqId(descriptor)?.let { proto.setExtension(JsKlibMetadataProtoBuf.valueParamUniqId, it) }
|
||||
super.serializeValueParameter(descriptor, proto)
|
||||
}
|
||||
|
||||
override fun serializeEnumEntry(descriptor: ClassDescriptor, proto: ProtoBuf.EnumEntry.Builder) {
|
||||
uniqId(descriptor)?.let { proto.setExtension(JsKlibMetadataProtoBuf.enumEntryUniqId, it) }
|
||||
super.serializeEnumEntry(descriptor, proto)
|
||||
|
||||
Reference in New Issue
Block a user