From c8feaa9b5725763c9259aa26dc8413b2247dc7a3 Mon Sep 17 00:00:00 2001 From: greg Date: Mon, 16 Jan 2017 00:43:04 -0800 Subject: [PATCH] Add logging of supplimental commands --- src/compilation.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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)