(source: &str, pred: F)
| 40 | .any(pred) |
| 41 | } |
| 42 | |
| 43 | fn count_instructions<F>(source: &str, pred: F) -> usize |
| 44 | where |
| 45 | F: Fn(&IrInstruction) -> bool, |
| 46 | { |
| 47 | let result = compile_ok(source); |
| 48 | result |
| 49 | .ir_program |
| 50 | .functions |
| 51 | .iter() |
| 52 | .flat_map(|f| f.blocks.iter()) |
| 53 | .flat_map(|b| b.instructions.iter()) |
| 54 | .filter(|i| pred(i)) |
| 55 | .count() |
| 56 | } |
| 57 |
nothing calls this directly
no test coverage detected