MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / has_terminator

Function has_terminator

tests/integration/ir_generation.rs:288–302  ·  view source on GitHub ↗
(source: &str, pred: F)

Source from the content-addressed store, hash-verified

286
287// -- Control flow lowering -----------------------------------------------------
288
289fn has_terminator<F>(source: &str, pred: F) -> bool
290where
291 F: Fn(&IrTerminator) -> bool,
292{
293 let result = CompilationPipeline::new()
294 .compile(source)
295 .unwrap_or_else(|e| panic!("expected ok, got: {e}"));
296 result
297 .ir_program
298 .functions
299 .iter()
300 .flat_map(|f| f.blocks.iter())
301 .filter_map(|b| b.terminator.as_ref())
302 .any(pred)
303}
304
305#[test]

Callers

nothing calls this directly

Calls 2

anyMethod · 0.80
compileMethod · 0.45

Tested by

no test coverage detected