Some cleanups.
This commit is contained in:
@@ -6,7 +6,7 @@ use codespan_reporting::term::termcolor::{ColorChoice, StandardStream};
|
||||
use cranelift_object::object;
|
||||
|
||||
use ngr::backend::BackendError;
|
||||
use ngr::backend::Program as Cranelift;
|
||||
use ngr::backend::Backend;
|
||||
use ngr::ir::Program as IR;
|
||||
use ngr::syntax::{ParserError, Program as Syntax};
|
||||
use target_lexicon::Triple;
|
||||
@@ -70,8 +70,9 @@ fn compile(file_database: &mut SimpleFiles<String, String>) -> Result<(), MainEr
|
||||
}
|
||||
|
||||
let ir = IR::from(syntax.simplify());
|
||||
let compiled = Cranelift::new(Triple::host(), ir)?;
|
||||
let bytes = compiled.bytes()?;
|
||||
let mut backend = Backend::object_file(Triple::host())?;
|
||||
backend.compile_function("gogogo", ir)?;
|
||||
let bytes = backend.bytes()?;
|
||||
std::fs::write(args.output.unwrap_or_else(|| "output.o".to_string()), bytes)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user