diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InteropUtils.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InteropUtils.kt index 6fd0a2fdb08..d8983d51199 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InteropUtils.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/InteropUtils.kt @@ -197,6 +197,8 @@ internal class InteropBuiltIns(builtIns: KonanBuiltIns) { val exportObjCClass = packageScope.getContributedClass("ExportObjCClass") + val CreateNSStringFromKString = packageScope.getContributedFunctions("CreateNSStringFromKString").single() + } private fun MemberScope.getContributedVariables(name: String) = diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/ContextUtils.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/ContextUtils.kt index a4cb306e1f2..962e736bedf 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/ContextUtils.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/ContextUtils.kt @@ -424,7 +424,6 @@ internal class Llvm(val context: Context, val llvmModule: LLVMModuleRef) { val Kotlin_ObjCExport_refToObjC by lazyRtFunction val Kotlin_ObjCExport_refFromObjC by lazyRtFunction - val Kotlin_Interop_CreateNSStringFromKString by lazyRtFunction val Kotlin_Interop_CreateNSArrayFromKList by lazyRtFunction val Kotlin_Interop_CreateNSMutableArrayFromKList by lazyRtFunction val Kotlin_Interop_CreateNSSetFromKSet by lazyRtFunction diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/objcexport/ObjCExportCodeGenerator.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/objcexport/ObjCExportCodeGenerator.kt index a842c6e43aa..a9f38bd07fd 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/objcexport/ObjCExportCodeGenerator.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/objcexport/ObjCExportCodeGenerator.kt @@ -414,7 +414,7 @@ private fun ObjCExportCodeGenerator.emitKotlinFunctionAdaptersToBlock() { private fun ObjCExportCodeGenerator.emitSpecialClassesConvertions() { setObjCExportTypeInfo( context.builtIns.string, - constPointer(context.llvm.Kotlin_Interop_CreateNSStringFromKString) + constPointer(codegen.llvmFunction(context.interopBuiltIns.CreateNSStringFromKString)) ) setObjCExportTypeInfo(