Struct rustc_borrowck::region_infer::values::LivenessValues
source · pub(crate) struct LivenessValues<N: Idx> {
elements: Rc<RegionValueElements>,
points: SparseIntervalMatrix<N, PointIndex>,
}
Expand description
When we initially compute liveness, we use an interval matrix storing liveness ranges for each region-vid.
Fields
elements: Rc<RegionValueElements>
points: SparseIntervalMatrix<N, PointIndex>
Implementations
sourceimpl<N: Idx> LivenessValues<N>
impl<N: Idx> LivenessValues<N>
sourcepub(crate) fn new(elements: Rc<RegionValueElements>) -> Self
pub(crate) fn new(elements: Rc<RegionValueElements>) -> Self
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.
sourcepub(crate) fn rows(&self) -> impl Iterator<Item = N>
pub(crate) fn rows(&self) -> impl Iterator<Item = N>
Iterate through each region that has a value in this set.
sourcepub(crate) fn add_element(&mut self, row: N, location: Location) -> bool
pub(crate) fn add_element(&mut self, row: N, location: Location) -> bool
Adds the given element to the value for the given region. Returns whether the element is newly added (i.e., was not already present).
sourcepub(crate) fn add_elements(
&mut self,
row: N,
locations: &IntervalSet<PointIndex>
) -> bool
pub(crate) fn add_elements(
&mut self,
row: N,
locations: &IntervalSet<PointIndex>
) -> bool
Adds all the elements in the given bit array into the given region. Returns whether any of them are newly added.
sourcepub(crate) fn add_all_points(&mut self, row: N)
pub(crate) fn add_all_points(&mut self, row: N)
Adds all the control-flow points to the values for r
.
sourcepub(crate) fn contains(&self, row: N, location: Location) -> bool
pub(crate) fn contains(&self, row: N, location: Location) -> bool
Returns true
if the region r
contains the given element.
sourcepub(crate) fn get_elements(&self, row: N) -> impl Iterator<Item = Location> + '_
pub(crate) fn get_elements(&self, row: N) -> impl Iterator<Item = Location> + '_
Returns an iterator of all the elements contained by the region r
sourcepub(crate) fn region_value_str(&self, r: N) -> String
pub(crate) fn region_value_str(&self, r: N) -> String
Returns a “pretty” string value of the region. Meant for debugging.
Auto Trait Implementations
impl<N> RefUnwindSafe for LivenessValues<N>
impl<N> !Send for LivenessValues<N>
impl<N> !Sync for LivenessValues<N>
impl<N> Unpin for LivenessValues<N>
impl<N> UnwindSafe for LivenessValues<N>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes