@@ -32,8 +32,6 @@ impl DenseLocationMap {
32
32
v
33
33
} )
34
34
. collect ( ) ;
35
- debug ! ( "DenseLocationMap: statements_before_block={:#?}" , statements_before_block) ;
36
- debug ! ( "DenseLocationMap: num_points={:#?}" , num_points) ;
37
35
38
36
let mut basic_blocks = IndexVec :: with_capacity ( num_points) ;
39
37
for ( bb, bb_data) in body. basic_blocks . iter_enumerated ( ) {
@@ -57,7 +55,7 @@ impl DenseLocationMap {
57
55
PointIndex :: new ( start_index + statement_index)
58
56
}
59
57
60
- /// Converts a `Location` into a `PointIndex `. O(1).
58
+ /// Returns the `PointIndex` for the first statement in the giben `BasicBlock `. O(1).
61
59
#[ inline]
62
60
pub fn entry_point ( & self , block : BasicBlock ) -> PointIndex {
63
61
let start_index = self . statements_before_block [ block] ;
@@ -106,8 +104,7 @@ pub struct LivenessValues<N: Idx> {
106
104
107
105
impl < N : Idx > LivenessValues < N > {
108
106
/// Creates a new set of "region values" that tracks causal information.
109
- /// Each of the regions in num_region_variables will be initialized with an
110
- /// empty set of points and no causal information.
107
+ /// Each of the regions is initialized with an empty set of points.
111
108
pub fn new ( elements : Rc < DenseLocationMap > ) -> Self {
112
109
Self { points : SparseIntervalMatrix :: new ( elements. num_points ) , elements }
113
110
}
@@ -120,30 +117,28 @@ impl<N: Idx> LivenessValues<N> {
120
117
/// Adds the given element to the value for the given region. Returns whether
121
118
/// the element is newly added (i.e., was not already present).
122
119
pub fn add_element ( & mut self , row : N , location : Location ) -> bool {
123
- debug ! ( "LivenessValues::add(r={:?}, location={:?})" , row, location) ;
124
120
let index = self . elements . point_from_location ( location) ;
125
121
self . points . insert ( row, index)
126
122
}
127
123
128
124
/// Adds all the elements in the given bit array into the given
129
125
/// region. Returns whether any of them are newly added.
130
126
pub fn add_elements ( & mut self , row : N , locations : & IntervalSet < PointIndex > ) -> bool {
131
- debug ! ( "LivenessValues::add_elements(row={:?}, locations={:?})" , row, locations) ;
132
127
self . points . union_row ( row, locations)
133
128
}
134
129
135
- /// Adds all the control-flow points to the values for `r `.
130
+ /// Adds all the control-flow points to the values for `row `.
136
131
pub fn add_all_points ( & mut self , row : N ) {
137
132
self . points . insert_all_into_row ( row) ;
138
133
}
139
134
140
- /// Returns `true` if the region `r ` contains the given element.
135
+ /// Returns `true` if the region `row ` contains the given element.
141
136
pub fn contains ( & self , row : N , location : Location ) -> bool {
142
137
let index = self . elements . point_from_location ( location) ;
143
138
self . points . row ( row) . is_some_and ( |r| r. contains ( index) )
144
139
}
145
140
146
- /// Returns an iterator of all the elements contained by the region `r `
141
+ /// Returns an iterator of all the elements contained by the region `row `
147
142
pub fn get_elements ( & self , row : N ) -> impl Iterator < Item = Location > + ' _ {
148
143
self . points
149
144
. row ( row)
0 commit comments