Changes after code review
This commit is contained in:
committed by
alexander-gorshenev
parent
d9ff5a9778
commit
92537557bc
+1
-1
@@ -146,7 +146,7 @@ internal val patchDeclarationParents0Phase = konanUnitPhase(
|
|||||||
|
|
||||||
internal val serializerPhase = konanUnitPhase(
|
internal val serializerPhase = konanUnitPhase(
|
||||||
op = {
|
op = {
|
||||||
val declarationTable = KonanDeclarationTable(irModule!!.irBuiltins, DescriptorTable()).apply { loadKnownBuiltins() }
|
val declarationTable = KonanDeclarationTable(irModule!!.irBuiltins, DescriptorTable())
|
||||||
val serializedIr = KonanIrModuleSerializer(this, declarationTable).serializedIrModule(irModule!!)
|
val serializedIr = KonanIrModuleSerializer(this, declarationTable).serializedIrModule(irModule!!)
|
||||||
val serializer = KonanSerializationUtil(this, config.configuration.get(CommonConfigurationKeys.METADATA_VERSION)!!, declarationTable)
|
val serializer = KonanSerializationUtil(this, config.configuration.get(CommonConfigurationKeys.METADATA_VERSION)!!, declarationTable)
|
||||||
serializedLinkData =
|
serializedLinkData =
|
||||||
|
|||||||
+4
-1
@@ -11,8 +11,11 @@ class KonanDeclarationTable(builtIns: IrBuiltIns, descriptorTable: DescriptorTab
|
|||||||
DeclarationTable(builtIns, descriptorTable, KonanMangler) {
|
DeclarationTable(builtIns, descriptorTable, KonanMangler) {
|
||||||
override var currentIndex = 0L
|
override var currentIndex = 0L
|
||||||
|
|
||||||
|
init {
|
||||||
|
loadKnownBuiltins()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is what we pre-populate tables with
|
// This is what we pre-populate tables with.
|
||||||
val IrBuiltIns.knownBuiltins
|
val IrBuiltIns.knownBuiltins
|
||||||
get() = irBuiltInsExternalPackageFragment.declarations
|
get() = irBuiltInsExternalPackageFragment.declarations
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ class KonanDescriptorReferenceDeserializer(
|
|||||||
Pair(null, getContributedDescriptors(packageFqNameString, name))
|
Pair(null, getContributedDescriptors(packageFqNameString, name))
|
||||||
} else {
|
} else {
|
||||||
val clazz = currentModule.findClassAcrossModuleDependencies(ClassId(packageFqName, classFqName, false))!!
|
val clazz = currentModule.findClassAcrossModuleDependencies(ClassId(packageFqName, classFqName, false))!!
|
||||||
Pair(clazz, getContributedDescriptors(clazz.unsubstitutedMemberScope, name) + clazz.getConstructors())
|
Pair(clazz, clazz.unsubstitutedMemberScope.getContributedDescriptors() + clazz.getConstructors())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packageFqNameString.startsWith("cnames.") || packageFqNameString.startsWith("objcnames.")) {
|
if (packageFqNameString.startsWith("cnames.") || packageFqNameString.startsWith("objcnames.")) {
|
||||||
|
|||||||
+1
-2
@@ -15,8 +15,7 @@ class KonanIrModuleSerializer(
|
|||||||
) : IrModuleSerializer(logger, declarationTable, KonanMangler, bodiesOnlyForInlines) {
|
) : IrModuleSerializer(logger, declarationTable, KonanMangler, bodiesOnlyForInlines) {
|
||||||
|
|
||||||
override fun backendSpecificExplicitRoot(declaration: IrFunction) =
|
override fun backendSpecificExplicitRoot(declaration: IrFunction) =
|
||||||
declaration.descriptor.annotations.hasAnnotation(RuntimeNames.exportForCppRuntime) ||
|
declaration.descriptor.annotations.hasAnnotation(RuntimeNames.exportForCppRuntime)
|
||||||
declaration.descriptor.annotations.hasAnnotation(RuntimeNames.exportForCompilerAnnotation)
|
|
||||||
|
|
||||||
override fun backendSpecificExplicitRoot(declaration: IrClass) =
|
override fun backendSpecificExplicitRoot(declaration: IrClass) =
|
||||||
declaration.descriptor.annotations.hasAnnotation(RuntimeNames.exportTypeInfoAnnotation)
|
declaration.descriptor.annotations.hasAnnotation(RuntimeNames.exportTypeInfoAnnotation)
|
||||||
|
|||||||
+1
-11
@@ -34,7 +34,7 @@ class KonanIrLinker(
|
|||||||
builtIns: IrBuiltIns,
|
builtIns: IrBuiltIns,
|
||||||
symbolTable: SymbolTable,
|
symbolTable: SymbolTable,
|
||||||
val forwardModuleDescriptor: ModuleDescriptor?)
|
val forwardModuleDescriptor: ModuleDescriptor?)
|
||||||
: KotlinIrLinker(currentModule, logger, builtIns, symbolTable, forwardModuleDescriptor),
|
: KotlinIrLinker(logger, builtIns, symbolTable, forwardModuleDescriptor, 0L),
|
||||||
DescriptorUniqIdAware by KonanDescriptorUniqIdAware {
|
DescriptorUniqIdAware by KonanDescriptorUniqIdAware {
|
||||||
|
|
||||||
private val forwardDeclarations = mutableSetOf<IrSymbol>()
|
private val forwardDeclarations = mutableSetOf<IrSymbol>()
|
||||||
@@ -42,14 +42,4 @@ class KonanIrLinker(
|
|||||||
override val descriptorReferenceDeserializer = KonanDescriptorReferenceDeserializer(currentModule, resolvedForwardDeclarations)
|
override val descriptorReferenceDeserializer = KonanDescriptorReferenceDeserializer(currentModule, resolvedForwardDeclarations)
|
||||||
|
|
||||||
override fun reader(moduleDescriptor: ModuleDescriptor, uniqId: UniqId) = moduleDescriptor.konanLibrary!!.irDeclaration(uniqId.index, uniqId.isLocal)
|
override fun reader(moduleDescriptor: ModuleDescriptor, uniqId: UniqId) = moduleDescriptor.konanLibrary!!.irDeclaration(uniqId.index, uniqId.isLocal)
|
||||||
|
|
||||||
init {
|
|
||||||
var currentIndex = 0L
|
|
||||||
builtIns.knownBuiltins.forEach {
|
|
||||||
require(it is IrFunction)
|
|
||||||
deserializedSymbols.put(UniqIdKey(null, UniqId(currentIndex, isLocal = false)), it.symbol)
|
|
||||||
assert(symbolTable.referenceSimpleFunction(it.descriptor) == it.symbol)
|
|
||||||
currentIndex++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -81,7 +81,7 @@ internal class KonanSerializerExtension(val context: Context, override val metad
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun serializeProperty(descriptor: PropertyDescriptor, proto: ProtoBuf.Property.Builder,
|
override fun serializeProperty(descriptor: PropertyDescriptor, proto: ProtoBuf.Property.Builder,
|
||||||
versionRequirementTable: MutableVersionRequirementTable,
|
versionRequirementTable: MutableVersionRequirementTable?,
|
||||||
childSerializer: DescriptorSerializer) {
|
childSerializer: DescriptorSerializer) {
|
||||||
proto.setExtension(KonanProtoBuf.propertyFile, sourceFileMap.assign(descriptor.source.containingFile))
|
proto.setExtension(KonanProtoBuf.propertyFile, sourceFileMap.assign(descriptor.source.containingFile))
|
||||||
uniqId(descriptor) ?.let { proto.setExtension(KonanProtoBuf.propertyUniqId, it) }
|
uniqId(descriptor) ?.let { proto.setExtension(KonanProtoBuf.propertyUniqId, it) }
|
||||||
|
|||||||
+3
-3
@@ -18,9 +18,9 @@
|
|||||||
buildKotlinVersion=1.3.30-dev-1945
|
buildKotlinVersion=1.3.30-dev-1945
|
||||||
buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_CompilerAllPlugins),number:1.3.30-dev-1945,pinned:true/artifacts/content/maven
|
buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_CompilerAllPlugins),number:1.3.30-dev-1945,pinned:true/artifacts/content/maven
|
||||||
remoteRoot=konan_tests
|
remoteRoot=konan_tests
|
||||||
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_CompilerAllPlugins),number:1.3.40-dev-392,branch:default:true,pinned:true/artifacts/content/maven
|
kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_CompilerAllPlugins),number:1.3.40-dev-605,branch:default:true,pinned:true/artifacts/content/maven
|
||||||
kotlinVersion=1.3.40-dev-392
|
kotlinVersion=1.3.40-dev-605
|
||||||
testKotlinVersion=1.3.40-dev-392
|
testKotlinVersion=1.3.40-dev-605
|
||||||
sharedRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinNativeShared_BuildAndTest),number:1.0-dev-16,branch:default:true,pinned:true/artifacts/content/maven
|
sharedRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinNativeShared_BuildAndTest),number:1.0-dev-16,branch:default:true,pinned:true/artifacts/content/maven
|
||||||
sharedVersion=1.0-dev-16
|
sharedVersion=1.0-dev-16
|
||||||
konanVersion=1.3.0
|
konanVersion=1.3.0
|
||||||
|
|||||||
Reference in New Issue
Block a user