From 600acc8e5e06ad535a57b02367d88c8341f92ebe Mon Sep 17 00:00:00 2001 From: lyken Date: Thu, 11 Jul 2024 16:23:04 +0800 Subject: [PATCH] standalone: DEBUG_STANDALONE_DUMP_IR --- nac3standalone/src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nac3standalone/src/main.rs b/nac3standalone/src/main.rs index c2a1d194..66fc8e7a 100644 --- a/nac3standalone/src/main.rs +++ b/nac3standalone/src/main.rs @@ -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", opt_level as u32);