@@ -138,43 +138,43 @@ impl<N: Idx> LivenessValues<N> {
138
138
139
139
/// Adds the given element to the value for the given region. Returns whether
140
140
/// the element is newly added (i.e., was not already present).
141
- pub ( crate ) fn add_element ( & mut self , row : N , location : Location ) -> bool {
142
- debug ! ( "LivenessValues::add(r ={:?}, location={:?})" , row , location) ;
141
+ pub ( crate ) fn add_element ( & mut self , region : N , location : Location ) -> bool {
142
+ debug ! ( "LivenessValues::add_element(region ={:?}, location={:?})" , region , location) ;
143
143
let index = self . elements . point_from_location ( location) ;
144
- self . points . insert ( row , index)
144
+ self . points . insert ( region , index)
145
145
}
146
146
147
147
/// Adds all the elements in the given bit array into the given
148
148
/// region. Returns whether any of them are newly added.
149
- pub ( crate ) fn add_elements ( & mut self , row : N , locations : & IntervalSet < PointIndex > ) -> bool {
150
- debug ! ( "LivenessValues::add_elements(row ={:?}, locations={:?})" , row , locations) ;
151
- self . points . union_row ( row , locations)
149
+ pub ( crate ) fn add_elements ( & mut self , region : N , locations : & IntervalSet < PointIndex > ) -> bool {
150
+ debug ! ( "LivenessValues::add_elements(region ={:?}, locations={:?})" , region , locations) ;
151
+ self . points . union_row ( region , locations)
152
152
}
153
153
154
- /// Adds all the control-flow points to the values for `r` .
155
- pub ( crate ) fn add_all_points ( & mut self , row : N ) {
156
- self . points . insert_all_into_row ( row ) ;
154
+ /// Records `region` as being live at all the control-flow points.
155
+ pub ( crate ) fn add_all_points ( & mut self , region : N ) {
156
+ self . points . insert_all_into_row ( region ) ;
157
157
}
158
158
159
- /// Returns `true` if the region `r ` contains the given element.
160
- pub ( crate ) fn contains ( & self , row : N , location : Location ) -> bool {
159
+ /// Returns `true` if the region `region ` contains the given element.
160
+ pub ( crate ) fn contains ( & self , region : N , location : Location ) -> bool {
161
161
let index = self . elements . point_from_location ( location) ;
162
- self . points . row ( row ) . is_some_and ( |r| r. contains ( index) )
162
+ self . points . row ( region ) . is_some_and ( |r| r. contains ( index) )
163
163
}
164
164
165
- /// Returns an iterator of all the elements contained by the region `r`
166
- pub ( crate ) fn get_elements ( & self , row : N ) -> impl Iterator < Item = Location > + ' _ {
165
+ /// Returns an iterator of all the elements contained by ` region`.
166
+ pub ( crate ) fn get_elements ( & self , region : N ) -> impl Iterator < Item = Location > + ' _ {
167
167
self . points
168
- . row ( row )
168
+ . row ( region )
169
169
. into_iter ( )
170
170
. flat_map ( |set| set. iter ( ) )
171
171
. take_while ( move |& p| self . elements . point_in_range ( p) )
172
172
. map ( move |p| self . elements . to_location ( p) )
173
173
}
174
174
175
175
/// Returns a "pretty" string value of the region. Meant for debugging.
176
- pub ( crate ) fn region_value_str ( & self , r : N ) -> String {
177
- region_value_str ( self . get_elements ( r ) . map ( RegionElement :: Location ) )
176
+ pub ( crate ) fn region_value_str ( & self , region : N ) -> String {
177
+ region_value_str ( self . get_elements ( region ) . map ( RegionElement :: Location ) )
178
178
}
179
179
180
180
#[ inline]
0 commit comments