fn add_liveness_constraints(&mut self, bb: BasicBlock) {
        debug!("add_liveness_constraints(bb={:?})", bb);

        self.liveness
            .regular
            .simulate_block(self.mir, bb, self.map, |location, live_locals| {
                for live_local in live_locals.iter() {
                    let local = self.map.from_live_var(live_local);
                    let live_local_ty = self.mir.local_decls[local].ty;
                    Self::push_type_live_constraint(&mut self.cx, live_local_ty, location);
                }
            });

        let mut all_live_locals: Vec<(Location, Vec<LocalWithRegion>)> = vec![];
        self.liveness
            .drop
            .simulate_block(self.mir, bb, self.map, |location, live_locals| {
                all_live_locals.push((location, live_locals.iter().collect()));
            });
        debug!(
            "add_liveness_constraints: all_live_locals={:#?}",
            all_live_locals
        );

        let terminator_index = self.mir.basic_blocks()[bb].statements.len();
        self.flow_inits.reset_to_entry_of(bb);
        while let Some((location, live_locals)) = all_live_locals.pop() {
            for live_local in live_locals {
                debug!(
                    "add_liveness_constraints: location={:?} live_local={:?}",
                    location, live_local
                );

                if log_enabled!(::log::Level::Debug) {
                    self.flow_inits.each_state_bit(|mpi_init| {
                        debug!(
                            "add_liveness_constraints: location={:?} initialized={:?}",
                            location,
                            &self.flow_inits.operator().move_data().move_paths[mpi_init]
                        );
                    });
                }

                let local = self.map.from_live_var(live_local);
                let mpi = self.move_data.rev_lookup.find_local(local);
                if let Some(initialized_child) = self.flow_inits.has_any_child_of(mpi) {
                    debug!(
                        "add_liveness_constraints: mpi={:?} has initialized child {:?}",
                        self.move_data.move_paths[mpi],
                        self.move_data.move_paths[initialized_child]
                    );

                    let local = self.map.from_live_var(live_local);
                    let live_local_ty = self.mir.local_decls[local].ty;
                    self.add_drop_live_constraint(live_local, live_local_ty, location);
                }
            }

            if location.statement_index == terminator_index {
                debug!(
                    "add_liveness_constraints: reconstruct_terminator_effect from {:#?}",
                    location
                );
                self.flow_inits.reconstruct_terminator_effect(location);
            } else {
                debug!(
                    "add_liveness_constraints: reconstruct_statement_effect from {:#?}",
                    location
                );
                self.flow_inits.reconstruct_statement_effect(location);
            }
            self.flow_inits.apply_local_effect(location);
        }
    }
/// Liveness constraints:
///
/// > If a variable V is live at point P, then all regions R in the type of V
/// > must include the point P.
Liveness constraints:
> If a variable V is live at point P, then all regions R in the type of V
> must include the point P.
Liveness constraints : > If a variable V is live at point P then all regions R in the type of V > must include the point P .
fn add_liveness_constraints(&mut self, bb: BasicBlock) {
        debug!("add_liveness_constraints(bb={:?})", bb);
        self.liveness
            .regular
            .simulate_block(self.mir, bb, self.map, |location, live_locals| {
                for live_local in live_locals.iter() {
                    let local = self.map.from_live_var(live_local);
                    let live_local_ty = self.mir.local_decls[local].ty;
                    Self::push_type_live_constraint(&mut self.cx, live_local_ty, location);
                }
            });
        let mut all_live_locals: Vec<(Location, Vec<LocalWithRegion>)> = vec![];
        self.liveness
            .drop
            .simulate_block(self.mir, bb, self.map, |location, live_locals| {
                all_live_locals.push((location, live_locals.iter().collect()));
            });
        debug!(
            "add_liveness_constraints: all_live_locals={:#?}",
            all_live_locals
        );
        let terminator_index = self.mir.basic_blocks()[bb].statements.len();
        self.flow_inits.reset_to_entry_of(bb);
        while let Some((location, live_locals)) = all_live_locals.pop() {
            for live_local in live_locals {
                debug!(
                    "add_liveness_constraints: location={:?} live_local={:?}",
                    location, live_local
                );
                if log_enabled!(::log::Level::Debug) {
                    self.flow_inits.each_state_bit(|mpi_init| {
                        debug!(
                            "add_liveness_constraints: location={:?} initialized={:?}",
                            location,
                            &self.flow_inits.operator().move_data().move_paths[mpi_init]
                        );
                    });
                }
                let local = self.map.from_live_var(live_local);
                let mpi = self.move_data.rev_lookup.find_local(local);
                if let Some(initialized_child) = self.flow_inits.has_any_child_of(mpi) {
                    debug!(
                        "add_liveness_constraints: mpi={:?} has initialized child {:?}",
                        self.move_data.move_paths[mpi],
                        self.move_data.move_paths[initialized_child]
                    );
                    let local = self.map.from_live_var(live_local);
                    let live_local_ty = self.mir.local_decls[local].ty;
                    self.add_drop_live_constraint(live_local, live_local_ty, location);
                }
            }
            if location.statement_index == terminator_index {
                debug!(
                    "add_liveness_constraints: reconstruct_terminator_effect from {:#?}",
                    location
                );
                self.flow_inits.reconstruct_terminator_effect(location);
            } else {
                debug!(
                    "add_liveness_constraints: reconstruct_statement_effect from {:#?}",
                    location
                );
                self.flow_inits.reconstruct_statement_effect(location);
            }
            self.flow_inits.apply_local_effect(location);
        }
    }
fn add_liveness_constraints ( & mut self , bb : BasicBlock ) { debug ! ( " " bb ) ; self . liveness . regular . simulate_block ( self . mir , bb , self . map , | location , live_locals | { for live_local in live_locals . iter ( ) { let local = self . map . from_live_var ( live_local ) ; let live_local_ty = self . mir . local_decls [ local ] . ty ; Self :: push_type_live_constraint ( & mut self . cx , live_local_ty , location ) ; } } ) ; let mut all_live_locals : Vec < ( Location , Vec < LocalWithRegion > ) > = vec ! [ ] ; self . liveness . drop . simulate_block ( self . mir , bb , self . map , | location , live_locals | { all_live_locals . push ( ( location , live_locals . iter ( ) . collect ( ) ) ) ; } ) ; debug ! ( " " all_live_locals ) ; let terminator_index = self . mir . basic_blocks ( ) [ bb ] . statements . len ( ) ; self . flow_inits . reset_to_entry_of ( bb ) ; while let Some ( ( location , live_locals ) ) = all_live_locals . pop ( ) { for live_local in live_locals { debug ! ( " " location live_local ) ; if log_enabled ! ( log Level Debug ) { self . flow_inits . each_state_bit ( | mpi_init | { debug ! ( " " location self flow_inits operator ( ) move_data ( ) move_paths [ mpi_init ] ) ; } ) ; } let local = self . map . from_live_var ( live_local ) ; let mpi = self . move_data . rev_lookup . find_local ( local ) ; if let Some ( initialized_child ) = self . flow_inits . has_any_child_of ( mpi ) { debug ! ( " " self move_data move_paths [ mpi ] self move_data move_paths [ initialized_child ] ) ; let local = self . map . from_live_var ( live_local ) ; let live_local_ty = self . mir . local_decls [ local ] . ty ; self . add_drop_live_constraint ( live_local , live_local_ty , location ) ; } } if location . statement_index == terminator_index { debug ! ( " " location ) ; self . flow_inits . reconstruct_terminator_effect ( location ) ; } else { debug ! ( " " location ) ; self . flow_inits . reconstruct_statement_effect ( location ) ; } self . flow_inits . apply_local_effect ( location ) ; } }
Liveness constraints:
> If a variable V is live at point P, then all regions R in the type of V
> must include the point P.
Liveness constraints : > If a variable V is live at point P then all regions R in the type of V > must include the point P .
&mut self
bb
BasicBlock
&mut self
bb
BasicBlock