Skip to content

Commit e5c64b5

Browse files
committed
Fix comment.
1 parent 4877167 commit e5c64b5

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

compiler/rustc_mir_dataflow/src/points.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ impl DenseLocationMap {
3232
v
3333
})
3434
.collect();
35-
debug!("DenseLocationMap: statements_before_block={:#?}", statements_before_block);
36-
debug!("DenseLocationMap: num_points={:#?}", num_points);
3735

3836
let mut basic_blocks = IndexVec::with_capacity(num_points);
3937
for (bb, bb_data) in body.basic_blocks.iter_enumerated() {
@@ -57,7 +55,7 @@ impl DenseLocationMap {
5755
PointIndex::new(start_index + statement_index)
5856
}
5957

60-
/// Converts a `Location` into a `PointIndex`. O(1).
58+
/// Returns the `PointIndex` for the first statement in the giben `BasicBlock`. O(1).
6159
#[inline]
6260
pub fn entry_point(&self, block: BasicBlock) -> PointIndex {
6361
let start_index = self.statements_before_block[block];
@@ -107,8 +105,7 @@ pub struct LivenessValues<N: Idx> {
107105

108106
impl<N: Idx> LivenessValues<N> {
109107
/// Creates a new set of "region values" that tracks causal information.
110-
/// Each of the regions in num_region_variables will be initialized with an
111-
/// empty set of points and no causal information.
108+
/// Each of the regions is initialized with an empty set of points.
112109
pub fn new(elements: Rc<DenseLocationMap>) -> Self {
113110
Self { points: SparseIntervalMatrix::new(elements.num_points), elements }
114111
}
@@ -127,30 +124,28 @@ impl<N: Idx> LivenessValues<N> {
127124
/// Adds the given element to the value for the given region. Returns whether
128125
/// the element is newly added (i.e., was not already present).
129126
pub fn add_element(&mut self, row: N, location: Location) -> bool {
130-
debug!("LivenessValues::add(r={:?}, location={:?})", row, location);
131127
let index = self.elements.point_from_location(location);
132128
self.points.insert(row, index)
133129
}
134130

135131
/// Adds all the elements in the given bit array into the given
136132
/// region. Returns whether any of them are newly added.
137133
pub fn add_elements(&mut self, row: N, locations: &IntervalSet<PointIndex>) -> bool {
138-
debug!("LivenessValues::add_elements(row={:?}, locations={:?})", row, locations);
139134
self.points.union_row(row, locations)
140135
}
141136

142-
/// Adds all the control-flow points to the values for `r`.
137+
/// Adds all the control-flow points to the values for `row`.
143138
pub fn add_all_points(&mut self, row: N) {
144139
self.points.insert_all_into_row(row);
145140
}
146141

147-
/// Returns `true` if the region `r` contains the given element.
142+
/// Returns `true` if the region `row` contains the given element.
148143
pub fn contains(&self, row: N, location: Location) -> bool {
149144
let index = self.elements.point_from_location(location);
150145
self.points.row(row).is_some_and(|r| r.contains(index))
151146
}
152147

153-
/// Returns an iterator of all the elements contained by the region `r`
148+
/// Returns an iterator of all the elements contained by the region `row`
154149
pub fn get_elements(&self, row: N) -> impl Iterator<Item = Location> + '_ {
155150
self.points
156151
.row(row)

0 commit comments

Comments
 (0)