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

Function inline_lets

src/transform/src/normalize_lets.rs:683–706  ·  view source on GitHub ↗
(
        expr: &mut MirRelationExpr,
        inline_mfp: bool,
    )

Source from the content-addressed store, hash-verified

681 use crate::normalize_lets::support::replace_bindings_from_map;
682
683 pub(super) fn inline_lets(
684 expr: &mut MirRelationExpr,
685 inline_mfp: bool,
686 ) -> Result<(), crate::TransformError> {
687 let mut worklist = vec![&mut *expr];
688 while let Some(expr) = worklist.pop() {
689 inline_lets_core(expr, inline_mfp)?;
690 // We descend only into `LetRec` nodes, because `promote_let_rec` ensured that all
691 // `LetRec` nodes are clustered near the root. This means that we can get to all the
692 // `LetRec` nodes by just descending into `LetRec` nodes, as there can't be any other
693 // nodes between them.
694 if let MirRelationExpr::LetRec {
695 ids: _,
696 values,
697 limits: _,
698 body,
699 } = expr
700 {
701 worklist.extend(values);
702 worklist.push(body);
703 }
704 }
705 Ok(())
706 }
707
708 /// Considers inlining actions to perform for a sequence of bindings and a
709 /// following body.

Callers 1

actionMethod · 0.85

Calls 4

inline_lets_coreFunction · 0.85
popMethod · 0.45
extendMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected