From 4e5fe71ca65020642361c4d3b3a3c2401864d5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Mon, 13 Nov 2023 14:39:32 +0000 Subject: [PATCH] stop referring to a region as a "row" in liveness values --- .../rustc_borrowck/src/region_infer/values.rs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/compiler/rustc_borrowck/src/region_infer/values.rs b/compiler/rustc_borrowck/src/region_infer/values.rs index 38452df32e9..bedf130a866 100644 --- a/compiler/rustc_borrowck/src/region_infer/values.rs +++ b/compiler/rustc_borrowck/src/region_infer/values.rs @@ -138,34 +138,34 @@ pub(crate) fn rows(&self) -> impl Iterator { /// 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(crate) fn add_element(&mut self, row: N, location: Location) -> bool { - debug!("LivenessValues::add(r={:?}, location={:?})", row, location); + pub(crate) fn add_element(&mut self, region: N, location: Location) -> bool { + debug!("LivenessValues::add_element(region={:?}, location={:?})", region, location); let index = self.elements.point_from_location(location); - self.points.insert(row, index) + self.points.insert(region, index) } /// Adds all the elements in the given bit array into the given /// region. Returns whether any of them are newly added. - pub(crate) fn add_elements(&mut self, row: N, locations: &IntervalSet) -> bool { - debug!("LivenessValues::add_elements(row={:?}, locations={:?})", row, locations); - self.points.union_row(row, locations) + pub(crate) fn add_elements(&mut self, region: N, locations: &IntervalSet) -> bool { + debug!("LivenessValues::add_elements(region={:?}, locations={:?})", region, locations); + self.points.union_row(region, locations) } - /// Adds all the control-flow points to the values for `r`. - pub(crate) fn add_all_points(&mut self, row: N) { - self.points.insert_all_into_row(row); + /// Records `region` as being live at all the control-flow points. + pub(crate) fn add_all_points(&mut self, region: N) { + self.points.insert_all_into_row(region); } - /// Returns `true` if the region `r` contains the given element. - pub(crate) fn contains(&self, row: N, location: Location) -> bool { + /// Returns `true` if the region `region` contains the given element. + pub(crate) fn contains(&self, region: N, location: Location) -> bool { let index = self.elements.point_from_location(location); - self.points.row(row).is_some_and(|r| r.contains(index)) + self.points.row(region).is_some_and(|r| r.contains(index)) } - /// Returns an iterator of all the elements contained by the region `r` - pub(crate) fn get_elements(&self, row: N) -> impl Iterator + '_ { + /// Returns an iterator of all the elements contained by `region`. + pub(crate) fn get_elements(&self, region: N) -> impl Iterator + '_ { self.points - .row(row) + .row(region) .into_iter() .flat_map(|set| set.iter()) .take_while(move |&p| self.elements.point_in_range(p)) @@ -173,8 +173,8 @@ pub(crate) fn get_elements(&self, row: N) -> impl Iterator + '_ } /// Returns a "pretty" string value of the region. Meant for debugging. - pub(crate) fn region_value_str(&self, r: N) -> String { - region_value_str(self.get_elements(r).map(RegionElement::Location)) + pub(crate) fn region_value_str(&self, region: N) -> String { + region_value_str(self.get_elements(region).map(RegionElement::Location)) } #[inline]