Make some unnamed LLVM globals private
This commit is contained in:
committed by
SvyatoslavScherbina
parent
66e8ce4cb2
commit
64b4d5bd18
+2
@@ -371,6 +371,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
|
|||||||
|
|
||||||
private fun createInitBody(): LLVMValueRef {
|
private fun createInitBody(): LLVMValueRef {
|
||||||
val initFunction = LLVMAddFunction(context.llvmModule, "", kInitFuncType)!!
|
val initFunction = LLVMAddFunction(context.llvmModule, "", kInitFuncType)!!
|
||||||
|
LLVMSetLinkage(initFunction, LLVMLinkage.LLVMPrivateLinkage)
|
||||||
generateFunction(codegen, initFunction) {
|
generateFunction(codegen, initFunction) {
|
||||||
using(FunctionScope(initFunction, "init_body", it)) {
|
using(FunctionScope(initFunction, "init_body", it)) {
|
||||||
val bbInit = basicBlock("init", null)
|
val bbInit = basicBlock("init", null)
|
||||||
@@ -465,6 +466,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
|
|||||||
|
|
||||||
private fun createInitCtor(initNodePtr: LLVMValueRef): LLVMValueRef {
|
private fun createInitCtor(initNodePtr: LLVMValueRef): LLVMValueRef {
|
||||||
val ctorFunction = LLVMAddFunction(context.llvmModule, "", kVoidFuncType)!!
|
val ctorFunction = LLVMAddFunction(context.llvmModule, "", kVoidFuncType)!!
|
||||||
|
LLVMSetLinkage(ctorFunction, LLVMLinkage.LLVMPrivateLinkage)
|
||||||
generateFunction(codegen, ctorFunction) {
|
generateFunction(codegen, ctorFunction) {
|
||||||
call(context.llvm.appendToInitalizersTail, listOf(initNodePtr))
|
call(context.llvm.appendToInitalizersTail, listOf(initNodePtr))
|
||||||
ret(null)
|
ret(null)
|
||||||
|
|||||||
Reference in New Issue
Block a user