mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-19 14:25:10 -04:00
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:
@@ -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);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user