forked from M-Labs/nac3
1
0
Fork 0

standalone: DEBUG_STANDALONE_DUMP_IR

This commit is contained in:
lyken 2024-07-11 16:23:04 +08:00
parent d658d9b00e
commit 600acc8e5e
1 changed files with 5 additions and 0 deletions

View File

@ -449,6 +449,11 @@ fn main() {
.create_target_machine(llvm_options.opt_level)
.expect("couldn't create target machine");
// Debug print if DEBUG_STANDALONE_DUMP_IR is defined
if std::env::var("DEBUG_STANDALONE_DUMP_IR").is_ok() {
main.print_to_file("standalone.ll").unwrap();
}
let pass_options = PassBuilderOptions::create();
pass_options.set_merge_functions(true);
let passes = format!("default<O{}>", opt_level as u32);