From 5337b0b471edd40f062ab8cc3ff2deac469c164d Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 16 Aug 2022 16:16:36 +0100 Subject: 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. --- src/llvm_backend.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/llvm_backend.cpp') 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; } -- cgit v1.2.3