aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 55ffb09c3..ff7aca3f2 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -3117,7 +3117,7 @@ void lb_begin_procedure_body(lbProcedure *p) {
}
}
- p->builder = LLVMCreateBuilder();
+ p->builder = LLVMCreateBuilderInContext(p->module->ctx);
p->decl_block = lb_create_block(p, "decls", true);
p->entry_block = lb_create_block(p, "entry", true);
@@ -12898,7 +12898,11 @@ lbAddr lb_build_addr(lbProcedure *p, Ast *expr) {
void lb_init_module(lbModule *m, Checker *c) {
m->info = &c->info;
+#if 1
m->ctx = LLVMGetGlobalContext();
+#else
+ m->ctx = LLVMContextCreate();
+#endif
m->mod = LLVMModuleCreateWithNameInContext("odin_module", m->ctx);
// m->debug_builder = nullptr;
if (build_context.ODIN_DEBUG) {