Use meta object for storing associated Objective-C object

This commit is contained in:
Svyatoslav Scherbina
2018-04-03 10:03:28 +03:00
committed by SvyatoslavScherbina
parent 841bb51e65
commit 38f896649c
8 changed files with 20 additions and 53 deletions
@@ -431,15 +431,6 @@ internal class Llvm(val context: Context, val llvmModule: LLVMModuleRef) {
val Kotlin_ObjCExport_RethrowExceptionAsNSError by lazyRtFunction
val Kotlin_ObjCExport_RethrowNSErrorAsException by lazyRtFunction
val kObjectReservedTailSize = if (context.config.produce.isNativeBinary) {
// Note: this defines the global declared in runtime (if any).
staticData.placeGlobal("kObjectReservedTailSize", Int32(0), isExported = true).also {
it.setConstant(true)
}
} else {
null
}
val objCExportEnabled = if (context.config.produce.isNativeBinary) {
// Note: this defines the global declared in runtime (if any).
staticData.placeGlobal("objCExportEnabled", Int8(0), isExported = true).also {
@@ -217,7 +217,6 @@ internal class ObjCExportCodeGenerator(
emitSortedAdapters(placedClassAdapters, "Kotlin_ObjCExport_sortedClassAdapters")
emitSortedAdapters(placedInterfaceAdapters, "Kotlin_ObjCExport_sortedProtocolAdapters")
context.llvm.kObjectReservedTailSize!!.setInitializer(Int32(runtime.pointerSize))
context.llvm.objCExportEnabled!!.setInitializer(Int8(1))
dataGenerator.finishModule() // TODO: move to appropriate place.