Struct rustc_borrowck::region_infer::values::LivenessValues
source · pub(crate) struct LivenessValues {
elements: Rc<RegionValueElements>,
points: SparseIntervalMatrix<RegionVid, PointIndex>,
pub(crate) loans: Option<LiveLoans>,
}
Expand description
Records the CFG locations where each region is live. When we initially compute liveness, we use an interval matrix storing liveness ranges for each region-vid.
Fields§
§elements: Rc<RegionValueElements>
The map from locations to points.
points: SparseIntervalMatrix<RegionVid, PointIndex>
For each region: the points where it is live.
loans: Option<LiveLoans>
When using -Zpolonius=next
, for each point: the loans flowing into the live regions at
that point.
Implementations§
source§impl LivenessValues
impl LivenessValues
sourcepub(crate) fn new(elements: Rc<RegionValueElements>) -> Self
pub(crate) fn new(elements: Rc<RegionValueElements>) -> Self
Create an empty map of regions to locations where they’re live.
sourcepub(crate) fn regions(&self) -> impl Iterator<Item = RegionVid>
pub(crate) fn regions(&self) -> impl Iterator<Item = RegionVid>
Iterate through each region that has a value in this set.
sourcepub(crate) fn add_location(&mut self, region: RegionVid, location: Location)
pub(crate) fn add_location(&mut self, region: RegionVid, location: Location)
Records region
as being live at the given location
.
sourcepub(crate) fn add_points(
&mut self,
region: RegionVid,
points: &IntervalSet<PointIndex>
)
pub(crate) fn add_points( &mut self, region: RegionVid, points: &IntervalSet<PointIndex> )
Records region
as being live at all the given points
.
sourcepub(crate) fn add_all_points(&mut self, region: RegionVid)
pub(crate) fn add_all_points(&mut self, region: RegionVid)
Records region
as being live at all the control-flow points.
sourcepub(crate) fn is_live_at(&self, region: RegionVid, location: Location) -> bool
pub(crate) fn is_live_at(&self, region: RegionVid, location: Location) -> bool
Returns whether region
is marked live at the given location
.
sourcepub(crate) fn is_live_anywhere(&self, region: RegionVid) -> bool
pub(crate) fn is_live_anywhere(&self, region: RegionVid) -> bool
Returns whether region
is marked live at any location.
sourcefn live_points(
&self,
region: RegionVid
) -> impl Iterator<Item = PointIndex> + '_
fn live_points( &self, region: RegionVid ) -> impl Iterator<Item = PointIndex> + '_
Returns an iterator of all the points where region
is live.
sourcepub(crate) fn pretty_print_live_points(&self, region: RegionVid) -> String
pub(crate) fn pretty_print_live_points(&self, region: RegionVid) -> String
For debugging purposes, returns a pretty-printed string of the points where the region
is
live.
pub(crate) fn point_from_location(&self, location: Location) -> PointIndex
sourcepub(crate) fn is_loan_live_at(
&self,
loan_idx: BorrowIndex,
point: PointIndex
) -> bool
pub(crate) fn is_loan_live_at( &self, loan_idx: BorrowIndex, point: PointIndex ) -> bool
When using -Zpolonius=next
, returns whether the loan_idx
is live at the given point
.
Auto Trait Implementations§
impl RefUnwindSafe for LivenessValues
impl !Send for LivenessValues
impl !Sync for LivenessValues
impl Unpin for LivenessValues
impl UnwindSafe for LivenessValues
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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: 104 bytes