Make sure builder uses the InContext version

This commit is contained in:
gingerBill
2021-05-03 14:36:27 +01:00
parent ca0f36be42
commit 3a5245dcce
+5 -1
View File
@@ -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) {