pub(crate) struct RegionValues<'tcx, N: Idx> {
location_map: Rc<DenseLocationMap>,
placeholder_indices: PlaceholderIndices<'tcx>,
points: SparseIntervalMatrix<N, PointIndex>,
free_regions: SparseBitMatrix<N, RegionVid>,
placeholders: SparseBitMatrix<N, PlaceholderIndex>,
}Expand description
Stores the full values for a set of regions (in contrast to
LivenessValues, which only stores those points in the where a
region is live). The full value for a region may contain points in
the CFG, but also free regions as well as bound universe
placeholders.
Example:
fn foo(x: &'a u32) -> &'a u32 {
let y: &'0 u32 = x; // let's call this `'0`
y
}Here, the variable '0 would contain the free region 'a,
because (since it is returned) it must live for at least 'a. But
it would also contain various points from within the function.
Fields§
§location_map: Rc<DenseLocationMap>§placeholder_indices: PlaceholderIndices<'tcx>§points: SparseIntervalMatrix<N, PointIndex>§free_regions: SparseBitMatrix<N, RegionVid>§placeholders: SparseBitMatrix<N, PlaceholderIndex>Placeholders represent bound regions – so something like 'a
in for<'a> fn(&'a u32).
Implementations§
Source§impl<'tcx, N: Idx> RegionValues<'tcx, N>
impl<'tcx, N: Idx> RegionValues<'tcx, N>
Sourcepub(crate) fn new(
location_map: Rc<DenseLocationMap>,
num_universal_regions: usize,
placeholder_indices: PlaceholderIndices<'tcx>,
) -> Self
pub(crate) fn new( location_map: Rc<DenseLocationMap>, num_universal_regions: usize, placeholder_indices: PlaceholderIndices<'tcx>, ) -> 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 add_region(&mut self, r_to: N, r_from: N) -> bool
pub(crate) fn add_region(&mut self, r_to: N, r_from: N) -> bool
Adds all elements in r_from to r_to (because e.g., r_to: r_from).
Sourcepub(crate) fn first_non_contained_inclusive(
&self,
r: N,
block: BasicBlock,
start: usize,
end: usize,
) -> Option<usize>
pub(crate) fn first_non_contained_inclusive( &self, r: N, block: BasicBlock, start: usize, end: usize, ) -> Option<usize>
Returns the lowest statement index in start..=end which is not contained by r.
Sourcepub(crate) fn merge_liveness(
&mut self,
to: N,
liveness: &IntervalSet<PointIndex>,
)
pub(crate) fn merge_liveness( &mut self, to: N, liveness: &IntervalSet<PointIndex>, )
Merge a row of liveness into our points.
Sourcepub(crate) fn contains_points(&self, sup_region: N, sub_region: N) -> bool
pub(crate) fn contains_points(&self, sup_region: N, sub_region: N) -> bool
Returns true if sup_region contains all the CFG points that
sub_region contains. Ignores universal regions.
Sourcepub(crate) fn locations_outlived_by(
&self,
r: N,
) -> impl Iterator<Item = Location>
pub(crate) fn locations_outlived_by( &self, r: N, ) -> impl Iterator<Item = Location>
Returns the locations contained within a given region r.
Sourcepub(crate) fn universal_regions_outlived_by(
&self,
r: N,
) -> impl Iterator<Item = RegionVid>
pub(crate) fn universal_regions_outlived_by( &self, r: N, ) -> impl Iterator<Item = RegionVid>
Returns just the universal regions that are contained in a given region’s value.
Sourcepub(crate) fn placeholders_contained_in(
&self,
r: N,
) -> impl Iterator<Item = PlaceholderRegion<'tcx>>
pub(crate) fn placeholders_contained_in( &self, r: N, ) -> impl Iterator<Item = PlaceholderRegion<'tcx>>
Returns all the elements contained in a given region’s value.
Sourcepub(crate) fn elements_contained_in(
&self,
r: N,
) -> impl Iterator<Item = RegionElement<'tcx>>
pub(crate) fn elements_contained_in( &self, r: N, ) -> impl Iterator<Item = RegionElement<'tcx>>
Returns all the elements contained in a given region’s value.
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.
Sourcepub(crate) fn add_free_region(&mut self, scc: N, region: RegionVid)
pub(crate) fn add_free_region(&mut self, scc: N, region: RegionVid)
Add a the free region with rvid region to SCC scc
pub(crate) fn add_placeholder( &mut self, scc: N, placeholder: PlaceholderRegion<'tcx>, )
Sourcepub(crate) fn contains_point(&self, scc: N, p: Location) -> bool
pub(crate) fn contains_point(&self, scc: N, p: Location) -> bool
Determine if scc contains the CFG point p.
Sourcepub(crate) fn contains_free_region(
&self,
scc: N,
free_region: RegionVid,
) -> bool
pub(crate) fn contains_free_region( &self, scc: N, free_region: RegionVid, ) -> bool
Determine if scc contains the free region free_region.
Auto Trait Implementations§
impl<'tcx, N> !DynSend for RegionValues<'tcx, N>
impl<'tcx, N> !DynSync for RegionValues<'tcx, N>
impl<'tcx, N> !Send for RegionValues<'tcx, N>
impl<'tcx, N> !Sync for RegionValues<'tcx, N>
impl<'tcx, N> Freeze for RegionValues<'tcx, N>
impl<'tcx, N> RefUnwindSafe for RegionValues<'tcx, N>
impl<'tcx, N> Unpin for RegionValues<'tcx, N>
impl<'tcx, N> UnsafeUnpin for RegionValues<'tcx, N>
impl<'tcx, N> UnwindSafe for RegionValues<'tcx, N>
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
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<K> IntoQueryKey<K> for K
impl<K> IntoQueryKey<K> for K
Source§fn into_query_key(self) -> K
fn into_query_key(self) -> K
Self to K.
This should always be a very cheap conversion, e.g. LocalDefId::to_def_id.Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
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: 160 bytes