fn combine_breaks(&mut self, entry: NodeIndex) {
        let cctx = self.cctx;

        loop {
            let mut combine = None;
            'l: for (na, &(_, ref wa)) in self.graph.node_references() {
                if let &Some(AstNodeC::Break) = wa {
                    for (nb, &(_, ref wb)) in self.graph.node_references() {
                        if na != nb {
                            if let &Some(AstNodeC::Break) = wb {
                                // check for code nodes between the two `break`s
                                let nodes = NodeSet::from_iter(&[na, nb]);
                                let ncd = graph_utils::nearest_common_dominator(
                                    &self.graph,
                                    entry,
                                    &nodes,
                                );
                                let mut common_preds =
                                    graph_utils::slice(&self.graph, ncd, &nodes).nodes;
                                common_preds.remove(na);
                                common_preds.remove(nb);
                                if common_preds.iter().all(|n| self.graph[n].1.is_none()) {
                                    combine = Some((ncd, na, nb));
                                    break 'l;
                                }
                            }
                        }
                    }
                }
            }

            if let Some((ncd, na, nb)) = combine {
                let (ca, _) = self.graph.remove_node(na).unwrap();
                let (cb, _) = self.graph.remove_node(nb).unwrap();
                let new_break = self
                    .graph
                    .add_node((cctx.mk_or(ca, cb), Some(AstNodeC::Break)));
                self.graph.add_edge(ncd, new_break, ());
            } else {
                return;
            }
        }
    }
/// Repeatedly look for and try to combine pairs of `break` nodes.
Repeatedly look for and try to combine pairs of `break` nodes.
Repeatedly look for and try to combine pairs of ` break ` nodes .
fn combine_breaks(&mut self, entry: NodeIndex) {
        let cctx = self.cctx;
        loop {
            let mut combine = None;
            'l: for (na, &(_, ref wa)) in self.graph.node_references() {
                if let &Some(AstNodeC::Break) = wa {
                    for (nb, &(_, ref wb)) in self.graph.node_references() {
                        if na != nb {
                            if let &Some(AstNodeC::Break) = wb {
                                // check for code nodes between the two `break`s
                                let nodes = NodeSet::from_iter(&[na, nb]);
                                let ncd = graph_utils::nearest_common_dominator(
                                    &self.graph,
                                    entry,
                                    &nodes,
                                );
                                let mut common_preds =
                                    graph_utils::slice(&self.graph, ncd, &nodes).nodes;
                                common_preds.remove(na);
                                common_preds.remove(nb);
                                if common_preds.iter().all(|n| self.graph[n].1.is_none()) {
                                    combine = Some((ncd, na, nb));
                                    break 'l;
                                }
                            }
                        }
                    }
                }
            }
            if let Some((ncd, na, nb)) = combine {
                let (ca, _) = self.graph.remove_node(na).unwrap();
                let (cb, _) = self.graph.remove_node(nb).unwrap();
                let new_break = self
                    .graph
                    .add_node((cctx.mk_or(ca, cb), Some(AstNodeC::Break)));
                self.graph.add_edge(ncd, new_break, ());
            } else {
                return;
            }
        }
    }
fn combine_breaks ( & mut self , entry : NodeIndex ) { let cctx = self . cctx ; loop { let mut combine = None ; ' l : for ( na , & ( _ , ref wa ) ) in self . graph . node_references ( ) { if let & Some ( AstNodeC :: Break ) = wa { for ( nb , & ( _ , ref wb ) ) in self . graph . node_references ( ) { if na != nb { if let & Some ( AstNodeC :: Break ) = wb { // check for code nodes between the two `break`s let nodes = NodeSet :: from_iter ( & [ na , nb ] ) ; let ncd = graph_utils :: nearest_common_dominator ( & self . graph , entry , & nodes , ) ; let mut common_preds = graph_utils :: slice ( & self . graph , ncd , & nodes ) . nodes ; common_preds . remove ( na ) ; common_preds . remove ( nb ) ; if common_preds . iter ( ) . all ( | n | self . graph [ n ] . 1 . is_none ( ) ) { combine = Some ( ( ncd , na , nb ) ) ; break ' l ; } } } } } } if let Some ( ( ncd , na , nb ) ) = combine { let ( ca , _ ) = self . graph . remove_node ( na ) . unwrap ( ) ; let ( cb , _ ) = self . graph . remove_node ( nb ) . unwrap ( ) ; let new_break = self . graph . add_node ( ( cctx . mk_or ( ca , cb ) , Some ( AstNodeC :: Break ) ) ) ; self . graph . add_edge ( ncd , new_break , ( ) ) ; } else { return ; } } }
Repeatedly look for and try to combine pairs of `break` nodes.
Repeatedly look for and try to combine pairs of ` break ` nodes .
&mut self
entry
NodeIndex
&mut self
entry
NodeIndex