From 983aad79b989edd75649478eee5a07d38657fe86 Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Thu, 1 Mar 2018 14:59:48 +0300 Subject: [PATCH] Fix init function name clash. (#1363) --- .../kotlin/backend/konan/llvm/IrToBitcode.kt | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt index 32e8cb0895b..dfaaeb7421f 100644 --- a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt +++ b/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/IrToBitcode.kt @@ -346,7 +346,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map) { + fun appendStaticInitializers() { val ctorName = context.config.moduleId.moduleConstructorName - val ctorFunction = LLVMAddFunction(context.llvmModule, ctorName, kVoidFuncType)!! // Create constructor function. + val ctorFunction = LLVMAddFunction(context.llvmModule, ctorName, kVoidFuncType)!! LLVMSetLinkage(ctorFunction, LLVMLinkage.LLVMExternalLinkage) generateFunction(codegen, ctorFunction) { val initGuard = LLVMAddGlobal(context.llvmModule, int32Type, "Konan_init_guard") @@ -2573,7 +2569,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map