diff --git a/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/decompiler/KotlinNativeMetadataDecompiler.kt b/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/decompiler/KotlinNativeMetadataDecompiler.kt index 0db360ec810..9fef4a0c29a 100644 --- a/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/decompiler/KotlinNativeMetadataDecompiler.kt +++ b/idea/idea-native/src/org/jetbrains/kotlin/ide/konan/decompiler/KotlinNativeMetadataDecompiler.kt @@ -9,15 +9,17 @@ import com.intellij.openapi.fileTypes.FileType import com.intellij.openapi.fileTypes.FileTypeConsumer import com.intellij.openapi.fileTypes.FileTypeFactory import com.intellij.openapi.vfs.VirtualFile +import org.jetbrains.kotlin.backend.common.serialization.metadata.KlibMetadataVersion import org.jetbrains.kotlin.library.KLIB_METADATA_FILE_EXTENSION import org.jetbrains.kotlin.library.metadata.KlibMetadataSerializerProtocol -import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion import org.jetbrains.kotlin.serialization.konan.NullFlexibleTypeDeserializer -class KotlinNativeMetadataDecompiler : KotlinNativeMetadataDecompilerBase( - KotlinNativeMetaFileType, { KlibMetadataSerializerProtocol }, NullFlexibleTypeDeserializer, - { KotlinNativeMetadataVersion.DEFAULT_INSTANCE }, - { KotlinNativeMetadataVersion.INVALID_VERSION }, +class KotlinNativeMetadataDecompiler : KotlinNativeMetadataDecompilerBase( + KotlinNativeMetaFileType, + { KlibMetadataSerializerProtocol }, + NullFlexibleTypeDeserializer, + { KlibMetadataVersion.INSTANCE }, + { KlibMetadataVersion.INVALID_VERSION }, KotlinNativeMetaFileType.STUB_VERSION ) { @@ -27,18 +29,6 @@ class KotlinNativeMetadataDecompiler : KotlinNativeMetadataDecompilerBase SourceElement = { SourceElement.NO_SOURCE } -) : ClassDataFinder { - private val classIdToProto = - proto.class_List.associateBy { klass -> - nameResolver.getClassId(klass.fqName) - } - - internal val allClassIds: Collection get() = classIdToProto.keys - - override fun findClassData(classId: ClassId): ClassData? { - val classProto = classIdToProto[classId] ?: return null - return ClassData(nameResolver, classProto, KotlinNativeMetadataVersion.DEFAULT_INSTANCE, classSource(classId)) - } -}