Only print errors if the programs failed
This commit is contained in:
parent
751c6f65bd
commit
eb6354e55a
@ -33,15 +33,20 @@ pub fn compilation_sequence(ast: AST, sourcefile: &str) {
|
|||||||
.output()
|
.output()
|
||||||
.expect("Failed to run llc");
|
.expect("Failed to run llc");
|
||||||
|
|
||||||
println!("{}", String::from_utf8_lossy(&llc_output.stderr));
|
|
||||||
|
if !llc_output.status.success() {
|
||||||
|
println!("{}", String::from_utf8_lossy(&llc_output.stderr));
|
||||||
|
}
|
||||||
|
|
||||||
let gcc_output = Command::new("gcc")
|
let gcc_output = Command::new("gcc")
|
||||||
.args(&["-o", bin_filename, &obj_filename])
|
.args(&["-o", bin_filename, &obj_filename])
|
||||||
.output()
|
.output()
|
||||||
.expect("failed to run gcc");
|
.expect("failed to run gcc");
|
||||||
|
|
||||||
println!("{}", String::from_utf8_lossy(&gcc_output.stdout));
|
if !gcc_output.status.success() {
|
||||||
println!("{}", String::from_utf8_lossy(&gcc_output.stderr));
|
println!("{}", String::from_utf8_lossy(&gcc_output.stdout));
|
||||||
|
println!("{}", String::from_utf8_lossy(&gcc_output.stderr));
|
||||||
|
}
|
||||||
|
|
||||||
for filename in [obj_filename].iter() {
|
for filename in [obj_filename].iter() {
|
||||||
Command::new("rm")
|
Command::new("rm")
|
||||||
|
Loading…
Reference in New Issue
Block a user