Use Context::for_function to simplify the code.

This commit is contained in:
Dan Gohman
2018-06-04 16:21:00 -07:00
parent ae8fc69406
commit 22a7c56108
8 changed files with 8 additions and 25 deletions

View File

@@ -31,9 +31,7 @@ impl SubTest for TestPostopt {
}
fn run(&self, func: Cow<Function>, context: &Context) -> Result<()> {
// Create a compilation context, and drop in the function.
let mut comp_ctx = cretonne_codegen::Context::new();
comp_ctx.func = func.into_owned();
let mut comp_ctx = cretonne_codegen::Context::for_function(func.into_owned());
let isa = context.isa.expect("postopt needs an ISA");
comp_ctx.flowgraph();