aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-05-03 14:36:27 +0100
committergingerBill <bill@gingerbill.org>2021-05-03 14:36:27 +0100
commit3a5245dcce79d3930d16b4968faa41c56e608b9a (patch)
tree96c60b4e863892d07abb06cde634beabf364bd2d /src/llvm_backend.cpp
parentca0f36be424afa1336b0e1ef0f7d0393a58cfe43 (diff)
Make sure builder uses the `InContext` version
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) {