MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / assert_letrec_major

Function assert_letrec_major

src/transform/src/normalize_lets.rs:651–671  ·  view source on GitHub ↗

Asserts that `expr` in "LetRec-major" form. This means `expr` is either `LetRec`-free, or a `LetRec` whose values and body are `LetRec`-major.

(expr: &MirRelationExpr)

Source from the content-addressed store, hash-verified

649 ///
650 /// This means `expr` is either `LetRec`-free, or a `LetRec` whose values and body are `LetRec`-major.
651 pub(crate) fn assert_letrec_major(expr: &MirRelationExpr) {
652 let mut todo = vec![expr];
653 while let Some(expr) = todo.pop() {
654 match expr {
655 MirRelationExpr::LetRec {
656 ids: _,
657 values,
658 limits: _,
659 body,
660 } => {
661 todo.extend(values.iter());
662 todo.push(body);
663 }
664 _ => {
665 expr.visit_pre(|expr| {
666 assert!(!matches!(expr, MirRelationExpr::LetRec { .. }));
667 });
668 }
669 }
670 }
671 }
672}
673
674mod inlining {

Callers 1

actionMethod · 0.85

Calls 5

popMethod · 0.45
extendMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45
visit_preMethod · 0.45

Tested by

no test coverage detected