diff --git a/compiler/rustc_mir_dataflow/src/points.rs b/compiler/rustc_mir_dataflow/src/points.rs index 3f7a983b85ee8..15159fbb0a49a 100644 --- a/compiler/rustc_mir_dataflow/src/points.rs +++ b/compiler/rustc_mir_dataflow/src/points.rs @@ -32,8 +32,6 @@ impl DenseLocationMap { v }) .collect(); - debug!("DenseLocationMap: statements_before_block={:#?}", statements_before_block); - debug!("DenseLocationMap: num_points={:#?}", num_points); let mut basic_blocks = IndexVec::with_capacity(num_points); for (bb, bb_data) in body.basic_blocks.iter_enumerated() { @@ -57,7 +55,7 @@ impl DenseLocationMap { PointIndex::new(start_index + statement_index) } - /// Converts a `Location` into a `PointIndex`. O(1). + /// Returns the `PointIndex` for the first statement in the giben `BasicBlock`. O(1). #[inline] pub fn entry_point(&self, block: BasicBlock) -> PointIndex { let start_index = self.statements_before_block[block]; @@ -106,8 +104,7 @@ pub struct LivenessValues { impl LivenessValues { /// Creates a new set of "region values" that tracks causal information. - /// Each of the regions in num_region_variables will be initialized with an - /// empty set of points and no causal information. + /// Each of the regions is initialized with an empty set of points. pub fn new(elements: Rc) -> Self { Self { points: SparseIntervalMatrix::new(elements.num_points), elements } } @@ -126,7 +123,6 @@ impl LivenessValues { /// Adds the given element to the value for the given region. Returns whether /// the element is newly added (i.e., was not already present). pub fn add_element(&mut self, row: N, location: Location) -> bool { - debug!("LivenessValues::add(r={:?}, location={:?})", row, location); let index = self.elements.point_from_location(location); self.points.insert(row, index) } @@ -134,22 +130,21 @@ impl LivenessValues { /// Adds all the elements in the given bit array into the given /// region. Returns whether any of them are newly added. pub fn add_elements(&mut self, row: N, locations: &IntervalSet) -> bool { - debug!("LivenessValues::add_elements(row={:?}, locations={:?})", row, locations); self.points.union_row(row, locations) } - /// Adds all the control-flow points to the values for `r`. + /// Adds all the control-flow points to the values for `row`. pub fn add_all_points(&mut self, row: N) { self.points.insert_all_into_row(row); } - /// Returns `true` if the region `r` contains the given element. + /// Returns `true` if the region `row` contains the given element. pub fn contains(&self, row: N, location: Location) -> bool { let index = self.elements.point_from_location(location); self.points.row(row).is_some_and(|r| r.contains(index)) } - /// Returns an iterator of all the elements contained by the region `r` + /// Returns an iterator of all the elements contained by the region `row` pub fn get_elements(&self, row: N) -> impl Iterator + '_ { self.points .row(row)