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

source

pub(crate) fn new(elements: Rc<RegionValueElements>) -> Self

Create an empty map of regions to locations where they’re live.

source

pub(crate) fn regions(&self) -> impl Iterator<Item = RegionVid>

Iterate through each region that has a value in this set.

source

pub(crate) fn add_location(&mut self, region: RegionVid, location: Location)

Records region as being live at the given location.

source

pub(crate) fn add_points( &mut self, region: RegionVid, points: &IntervalSet<PointIndex> )

Records region as being live at all the given points.

source

pub(crate) fn add_all_points(&mut self, region: RegionVid)

Records region as being live at all the control-flow points.

source

pub(crate) fn is_live_at(&self, region: RegionVid, location: Location) -> bool

Returns whether region is marked live at the given location.

source

pub(crate) fn is_live_anywhere(&self, region: RegionVid) -> bool

Returns whether region is marked live at any location.

source

fn live_points( &self, region: RegionVid ) -> impl Iterator<Item = PointIndex> + '_

Returns an iterator of all the points where region is live.

source

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.

source

pub(crate) fn point_from_location(&self, location: Location) -> PointIndex

source

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§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

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