Commonized SourceMap with FileRegistry
This commit is contained in:
committed by
alexander-gorshenev
parent
5a2ad645fc
commit
cfb97536d2
-24
@@ -160,28 +160,4 @@ internal val DeclarationDescriptor.isExpectMember: Boolean
|
||||
internal val DeclarationDescriptor.isSerializableExpectClass: Boolean
|
||||
get() = this is ClassDescriptor && ExpectedActualDeclarationChecker.shouldGenerateExpectClass(this)
|
||||
|
||||
// TODO: temporary disabling. Need to figure out proper SourceFileMap and FileRegistry commonization.
|
||||
//private fun sourceByIndex(descriptor: CallableMemberDescriptor, index: Int): SourceFile {
|
||||
// val fragment = descriptor.findPackage() as KonanPackageFragment
|
||||
// return fragment.sourceFileMap.sourceFile(index)
|
||||
//}
|
||||
|
||||
fun CallableMemberDescriptor.findSourceFile(): SourceFile {
|
||||
val source = this.source.containingFile
|
||||
if (source != SourceFile.NO_SOURCE_FILE)
|
||||
return source
|
||||
return when {
|
||||
// TODO: temporary disabling. Need to figure out proper SourceFileMap and FileRegistry commonization.
|
||||
this is DeserializedSimpleFunctionDescriptor && proto.hasExtension(KlibMetadataProtoBuf.functionFile) ->
|
||||
SourceFile.NO_SOURCE_FILE
|
||||
//sourceByIndex(
|
||||
// this, proto.getExtension(KlibMetadataProtoBuf.functionFile))
|
||||
this is DeserializedPropertyDescriptor && proto.hasExtension(KlibMetadataProtoBuf.propertyFile) ->
|
||||
SourceFile.NO_SOURCE_FILE
|
||||
//sourceByIndex(
|
||||
// this, proto.getExtension(KlibMetadataProtoBuf.propertyFile))
|
||||
else -> TODO()
|
||||
}
|
||||
}
|
||||
|
||||
val ModuleDescriptor.konanLibrary get() = (this.klibModuleOrigin as? DeserializedKlibModuleOrigin)?.library
|
||||
|
||||
+1
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.konan.objcexport
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.findSourceFile
|
||||
import org.jetbrains.kotlin.backend.konan.*
|
||||
import org.jetbrains.kotlin.backend.konan.descriptors.*
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
|
||||
Reference in New Issue
Block a user