From 8e9bd3df04747a9782fbf193159215f183b7d0d9 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 30 Mar 2020 16:19:49 +0800 Subject: [PATCH] print IR --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 11bd6bafa..72b7cbe9b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -424,6 +424,10 @@ impl<'ctx> CodeGen<'ctx> { } } + fn print_ir(&self) { + self.module.print_to_stderr(); + } + fn output(&self) { let triple = TargetTriple::create("riscv32-none-linux-gnu"); let target = Target::from_triple(&triple) @@ -464,5 +468,6 @@ fn main() { Ok(_) => (), Err(err) => { println!("Compilation error: {}", err); return; } } + codegen.print_ir(); codegen.output(); }