(&self, func: Cow<ir::Function>, context: &Context)
| 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 | } |
nothing calls this directly
no test coverage detected