diff options
| author | gingerBill <bill@gingerbill.org> | 2022-08-16 16:16:36 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2022-08-16 16:16:36 +0100 |
| commit | 5337b0b471edd40f062ab8cc3ff2deac469c164d (patch) | |
| tree | b50f85a2bb6dd796bfc306ef1616c17461a3289a /src/llvm_backend.cpp | |
| parent | e51afc350959617cace1c4fb6b9064802d54f254 (diff) | |
Revert "Remove debug message"
This reverts commit 22d16c20f8e446fb51d7faa14f22b9f86df8b393.
Revert "Correct global constant procedure initialization"
This reverts commit 697c839c84b36b4e0c12ac9ea264e28f564ef5d5.
Revert "Clean up how procedures are typed in LLVM's dumb type system"
This reverts commit de8bd88d2a6f0e99af6fe76442bcccd159724872.
Diffstat (limited to 'src/llvm_backend.cpp')
| -rw-r--r-- | src/llvm_backend.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index 64b2ac5f3..6ee1541d6 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -739,11 +739,11 @@ lbProcedure *lb_create_startup_runtime(lbModule *main_module, lbProcedure *start lb_begin_procedure_body(p); if (startup_type_info) { - OdinLLVMBuildCall(p, {startup_type_info->value, startup_type_info->type}, nullptr, 0); + LLVMBuildCall2(p->builder, lb_type_internal_for_procedures_raw(main_module, startup_type_info->type), startup_type_info->value, nullptr, 0, ""); } if (objc_names) { - OdinLLVMBuildCall(p, {objc_names->value, objc_names->type}, nullptr, 0); + LLVMBuildCall2(p->builder, lb_type_internal_for_procedures_raw(main_module, objc_names->type), objc_names->value, nullptr, 0, ""); } for_array(i, global_variables) { @@ -780,10 +780,6 @@ lbProcedure *lb_create_startup_runtime(lbModule *main_module, lbProcedure *start var->init = init; } else if (lb_is_const_or_global(init)) { if (!var->is_initialized) { - if (is_type_proc(init.type)) { - LLVMTypeRef global_type = llvm_addr_type(p->module, var->var); - init.value = LLVMConstPointerCast(init.value, global_type); - } LLVMSetInitializer(var->var.value, init.value); var->is_initialized = true; continue; @@ -1653,10 +1649,6 @@ void lb_generate_code(lbGenerator *gen) { if (tav.value.kind != ExactValue_Invalid) { ExactValue v = tav.value; lbValue init = lb_const_value(m, tav.type, v); - if (is_type_proc(init.type)) { - LLVMTypeRef global_type = llvm_addr_type(m, var.var); - init.value = LLVMConstPointerCast(init.value, global_type); - } LLVMSetInitializer(g.value, init.value); var.is_initialized = true; } |