From a0c206dc8d9e01e265904606d5581eb908ad22e3 Mon Sep 17 00:00:00 2001 From: David Mak Date: Fri, 29 Sep 2023 16:41:32 +0800 Subject: [PATCH] standalone: Emit IRRT IR --- nac3standalone/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nac3standalone/src/main.rs b/nac3standalone/src/main.rs index 16f3aaef..8d724052 100644 --- a/nac3standalone/src/main.rs +++ b/nac3standalone/src/main.rs @@ -354,7 +354,12 @@ fn main() { main.link_in_module(other).unwrap(); } - main.link_in_module(load_irrt(&context)).unwrap(); + + let irrt = load_irrt(&context); + if emit_llvm { + irrt.write_bitcode_to_path(Path::new("irrt.bc")); + } + main.link_in_module(irrt).unwrap(); let mut function_iter = main.get_first_function(); while let Some(func) = function_iter {