MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / run

Method run

cranelift/filetests/src/test_optimize.rs:52–68  ·  view source on GitHub ↗
(&self, func: Cow<ir::Function>, context: &Context)

Source from the content-addressed store, hash-verified

50 }
51
52 fn run(&self, func: Cow<ir::Function>, context: &Context) -> Result<()> {
53 let isa = context.isa.expect("optimize needs an ISA");
54 let mut comp_ctx = cranelift_codegen::Context::for_function(func.into_owned());
55
56 comp_ctx
57 .optimize(isa, &mut ControlPlane::default())
58 .map_err(|e| crate::pretty_anyhow_error(&comp_ctx.func, e))?;
59
60 let clif = format!("{:?}", comp_ctx.func);
61
62 if self.precise_output {
63 let actual: Vec<_> = clif.lines().collect();
64 check_precise_output(&actual, context)
65 } else {
66 run_filecheck(&clif, context)
67 }
68 }
69}

Callers

nothing calls this directly

Calls 7

pretty_anyhow_errorFunction · 0.85
check_precise_outputFunction · 0.85
run_filecheckFunction · 0.85
into_ownedMethod · 0.80
optimizeMethod · 0.80
collectMethod · 0.80
expectMethod · 0.45

Tested by

no test coverage detected