Remove many LLVM optimization passes which were causes UB due to them assuming C-like behaviour incompatible with Odin

This commit is contained in:
gingerBill
2021-11-06 17:23:33 +00:00
parent 5df15b5724
commit 3d3785a7f1
6 changed files with 83 additions and 41 deletions
+2 -1
View File
@@ -684,7 +684,8 @@ lbProcedure *lb_create_startup_runtime(lbModule *main_module, lbProcedure *start
if (init.value == nullptr) {
LLVMTypeRef global_type = LLVMGetElementType(LLVMTypeOf(var->var.value));
if (is_type_untyped_undef(init.type)) {
LLVMSetInitializer(var->var.value, LLVMGetUndef(global_type));
// LLVMSetInitializer(var->var.value, LLVMGetUndef(global_type));
LLVMSetInitializer(var->var.value, LLVMConstNull(global_type));
var->is_initialized = true;
continue;
} else if (is_type_untyped_nil(init.type)) {