From 034aead9301305d41756ef3b5b9b60a88c95d825 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 27 Oct 2023 14:55:54 +0100 Subject: [PATCH 1/2] Only make static map get calls inlineable outside of debug builds --- src/llvm_backend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index 8f5d8966d..716c50837 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -506,9 +506,9 @@ gb_internal lbValue lb_map_get_proc_for_type(lbModule *m, Type *type) { LLVMSetLinkage(p->value, LLVMInternalLinkage); lb_add_attribute_to_proc(m, p->value, "nounwind"); - // if (build_context.ODIN_DEBUG) { + if (build_context.ODIN_DEBUG) { lb_add_attribute_to_proc(m, p->value, "noinline"); - // } + } LLVMValueRef x = LLVMGetParam(p->value, 0); LLVMValueRef y = LLVMGetParam(p->value, 1); From 1d9f6346d47957d762887cceca37851f84eabeeb Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 29 Oct 2023 17:23:24 +0000 Subject: [PATCH 2/2] Force dynamic map calls on non-windows targets --- src/build_settings.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 1852013d5..ffb276d1e 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -1388,8 +1388,10 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta bc->optimization_level = gb_clamp(bc->optimization_level, -1, 3); - // ENFORCE DYNAMIC MAP CALLS - // bc->dynamic_map_calls = false; + if (bc->metrics.os != TargetOs_windows) { + // ENFORCE DYNAMIC MAP CALLS + bc->dynamic_map_calls = true; + } bc->ODIN_VALGRIND_SUPPORT = false; if (build_context.metrics.os != TargetOs_windows) {