Remove llc/opt hack. XX.bc now contains useful debug info thanks to removal of optimization flags in debug builds.

This commit is contained in:
lachsinc
2018-09-18 14:17:43 +10:00
parent 2f86f8f8e0
commit 8a789e33b0
2 changed files with 17 additions and 20 deletions

View File

@@ -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);