diff options
| author | korvahkh <92224397+korvahkh@users.noreply.github.com> | 2024-06-13 01:27:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-13 01:27:44 +0000 |
| commit | 104ca2ce22c269b71df08edb00cb26bee4daf59d (patch) | |
| tree | ee0a3275d3b42ae9aa85d09bf01f278d3965cc31 /src/llvm_backend_stmt.cpp | |
| parent | a7a6ff8c693be92929327660fd446dfc0af62e01 (diff) | |
| parent | a67df0739245d85e7aa773e7271a64121ca534c5 (diff) | |
Merge branch 'odin-lang:master' into fix-omitempty-comma
Diffstat (limited to 'src/llvm_backend_stmt.cpp')
| -rw-r--r-- | src/llvm_backend_stmt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/llvm_backend_stmt.cpp b/src/llvm_backend_stmt.cpp index b18db4e45..9f28e45e0 100644 --- a/src/llvm_backend_stmt.cpp +++ b/src/llvm_backend_stmt.cpp @@ -1850,7 +1850,9 @@ gb_internal void lb_build_static_variables(lbProcedure *p, AstValueDecl *vd) { LLVMSetInitializer(global, LLVMConstNull(lb_type(p->module, e->type))); if (value.value != nullptr) { LLVMSetInitializer(global, value.value); - } else { + } + if (e->Variable.is_rodata) { + LLVMSetGlobalConstant(global, true); } if (e->Variable.thread_local_model != "") { LLVMSetThreadLocal(global, true); |