[K/N] Move KonanIrModuleSerializer to serialization.native
KT-64392
This commit is contained in:
committed by
Space Team
parent
199d9d4880
commit
a1970d3d57
+7
-2
@@ -1,12 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.backend.konan.serialization
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.serialization.CompatibilityMode
|
||||
import org.jetbrains.kotlin.backend.common.serialization.IrModuleSerializer
|
||||
import org.jetbrains.kotlin.backend.konan.ir.interop.IrProviderForCEnumAndCStructStubs
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.ir.IrBuiltIns
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.ir.util.IrMessageLogger
|
||||
import org.jetbrains.kotlin.name.NativeStandardInteropNames
|
||||
|
||||
class KonanIrModuleSerializer(
|
||||
messageLogger: IrMessageLogger,
|
||||
@@ -28,7 +33,7 @@ class KonanIrModuleSerializer(
|
||||
// We may switch from IR generation to LazyIR later (at least for structs; enums are tricky)
|
||||
// without changing kotlin libraries that depend on interop libraries.
|
||||
override fun backendSpecificFileFilter(file: IrFile): Boolean =
|
||||
file.fileEntry.name != IrProviderForCEnumAndCStructStubs.cTypeDefinitionsFileName
|
||||
file.fileEntry.name != NativeStandardInteropNames.cTypeDefinitionsFileName
|
||||
|
||||
override fun createSerializerForFile(file: IrFile): KonanIrFileSerializer =
|
||||
KonanIrFileSerializer(messageLogger, KonanDeclarationTable(globalDeclarationTable),
|
||||
+3
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.name
|
||||
|
||||
@Suppress("ConstPropertyName")
|
||||
object NativeStandardInteropNames {
|
||||
val cInteropPackage = FqName("kotlinx.cinterop")
|
||||
|
||||
@@ -32,4 +33,6 @@ object NativeStandardInteropNames {
|
||||
|
||||
val syntheticPackages = setOf(cNamesPackage, objCNamesPackage)
|
||||
}
|
||||
|
||||
const val cTypeDefinitionsFileName = "CTypeDefinitions"
|
||||
}
|
||||
-4
@@ -117,8 +117,4 @@ internal class IrProviderForCEnumAndCStructStubs(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val cTypeDefinitionsFileName = "CTypeDefinitions"
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -27,6 +27,7 @@ import org.jetbrains.kotlin.ir.util.NaiveSourceBasedFileEntryImpl
|
||||
import org.jetbrains.kotlin.library.KotlinAbiVersion
|
||||
import org.jetbrains.kotlin.library.KotlinLibrary
|
||||
import org.jetbrains.kotlin.library.metadata.isInteropLibrary
|
||||
import org.jetbrains.kotlin.name.NativeStandardInteropNames
|
||||
|
||||
internal class KonanInteropModuleDeserializer(
|
||||
moduleDescriptor: ModuleDescriptor,
|
||||
@@ -65,7 +66,7 @@ internal class KonanInteropModuleDeserializer(
|
||||
|
||||
private fun getIrFile(packageFragment: PackageFragmentDescriptor): IrFile = fileMap.getOrPut(packageFragment) {
|
||||
IrFileImpl(
|
||||
NaiveSourceBasedFileEntryImpl(IrProviderForCEnumAndCStructStubs.cTypeDefinitionsFileName),
|
||||
NaiveSourceBasedFileEntryImpl(NativeStandardInteropNames.cTypeDefinitionsFileName),
|
||||
packageFragment,
|
||||
moduleFragment
|
||||
).also {
|
||||
|
||||
Reference in New Issue
Block a user