From 8a789e33b03e7842f36205cbb5a41c3a87134c77 Mon Sep 17 00:00:00 2001 From: lachsinc Date: Tue, 18 Sep 2018 14:17:43 +1000 Subject: Remove llc/opt hack. XX.bc now contains useful debug info thanks to removal of optimization flags in debug builds. --- src/build_settings.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/build_settings.cpp') diff --git a/src/build_settings.cpp b/src/build_settings.cpp index cbf6fb689..50197202b 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -573,10 +573,23 @@ void init_build_context(void) { bc->optimization_level = gb_clamp(bc->optimization_level, 0, 3); - gbString opt_flags = gb_string_make_reserve(heap_allocator(), 16); + gbString opt_flags = gb_string_make_reserve(heap_allocator(), 64); + opt_flags = gb_string_append_fmt(opt_flags, "-O%d ", bc->optimization_level); if (bc->optimization_level != 0) { - opt_flags = gb_string_append_fmt(opt_flags, "-O%d", bc->optimization_level); + // NOTE(lachsinc): The following options were previously passed during call + // to opt in main.cpp:exec_llvm_opt(). + // -die: Dead instruction elimination + // -memcpyopt: MemCpy optimization + opt_flags = gb_string_appendc(opt_flags, "-memcpyopt -die "); } + + // NOTE(lachsinc): This optimization option was previously required to get + // around an issue in fmt.odin. Thank bp for tracking it down! Leaving for now until the issue + // is resolved and confirmed by Bill. Maybe it should be readded in non-debug builds. + // if (bc->ODIN_DEBUG == false) { + // opt_flags = gb_string_appendc(opt_flags, "-mem2reg "); + // } + bc->opt_flags = make_string_c(opt_flags); -- cgit v1.2.3