diff options
| author | lachsinc <lachlansinclair@gmail.com> | 2018-09-18 14:17:43 +1000 |
|---|---|---|
| committer | lachsinc <lachlansinclair@gmail.com> | 2018-09-18 14:17:43 +1000 |
| commit | 8a789e33b03e7842f36205cbb5a41c3a87134c77 (patch) | |
| tree | 29dc6761a8ce3215acba76a14aea263cf7218654 /src/build_settings.cpp | |
| parent | 2f86f8f8e0618a88c2794362e5f99db29876ef9d (diff) | |
Remove llc/opt hack. XX.bc now contains useful debug info thanks to removal of optimization flags in debug builds.
Diffstat (limited to 'src/build_settings.cpp')
| -rw-r--r-- | src/build_settings.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
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); |