diff --git a/src/compilation.rs b/src/compilation.rs index 431b0aa..8a4144a 100644 --- a/src/compilation.rs +++ b/src/compilation.rs @@ -21,18 +21,24 @@ pub fn compilation_sequence(ast: AST, sourcefile: &str) { }; compile_ast(ast, ll_filename); - Command::new("llc") + let llc_output = Command::new("llc") .arg("-filetype=obj") .arg(ll_filename) .output() .expect("Failed to run llc"); - Command::new("gcc") + println!("{}", String::from_utf8_lossy(&llc_output.stdout)); + println!("{}", String::from_utf8_lossy(&llc_output.stderr)); + + let gcc_output = Command::new("gcc") .arg(format!("-o{}", bin_filename)) .arg(obj_filename) .output() .expect("failed to run gcc"); + println!("{}", String::from_utf8_lossy(&gcc_output.stdout)); + println!("{}", String::from_utf8_lossy(&gcc_output.stderr)); + for filename in [obj_filename].iter() { Command::new("rm") .arg(filename)