(
expr: &mut MirRelationExpr,
inline_mfp: bool,
)
| 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. |
no test coverage detected