aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_opt.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-04-08 11:36:53 +0100
committergingerBill <bill@gingerbill.org>2025-04-08 11:36:53 +0100
commitfe040d1bbd22c78081ffc1d45b3462f40f8eb17a (patch)
tree005c8d5bca1c0e5508442fa0d7180036565b0b20 /src/llvm_backend_opt.cpp
parent77b5eebf8ce090839713fc59fe0f60045524043f (diff)
Propagate `@(link_section=<string>)` to nested declarations
Diffstat (limited to 'src/llvm_backend_opt.cpp')
-rw-r--r--src/llvm_backend_opt.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llvm_backend_opt.cpp b/src/llvm_backend_opt.cpp
index 7fe1359b4..8d5cfcb70 100644
--- a/src/llvm_backend_opt.cpp
+++ b/src/llvm_backend_opt.cpp
@@ -516,7 +516,7 @@ gb_internal void llvm_delete_function(LLVMValueRef func) {
LLVMDeleteFunction(func);
}
-gb_internal void lb_append_to_compiler_used(lbModule *m, LLVMValueRef func) {
+gb_internal void lb_append_to_compiler_used(lbModule *m, LLVMValueRef value) {
LLVMValueRef global = LLVMGetNamedGlobal(m->mod, "llvm.compiler.used");
LLVMValueRef *constants;
@@ -544,7 +544,7 @@ gb_internal void lb_append_to_compiler_used(lbModule *m, LLVMValueRef func) {
LLVMTypeRef Int8PtrTy = LLVMPointerType(LLVMInt8TypeInContext(m->ctx), 0);
LLVMTypeRef ATy = llvm_array_type(Int8PtrTy, operands);
- constants[operands - 1] = LLVMConstBitCast(func, Int8PtrTy);
+ constants[operands - 1] = LLVMConstBitCast(value, Int8PtrTy);
LLVMValueRef initializer = LLVMConstArray(Int8PtrTy, constants, operands);
global = LLVMAddGlobal(m->mod, ATy, "llvm.compiler.used");