Struct rustc_borrowck::region_infer::values::RegionValueElements
source · pub(crate) struct RegionValueElements {
statements_before_block: IndexVec<BasicBlock, usize>,
basic_blocks: IndexVec<PointIndex, BasicBlock>,
num_points: usize,
}
Expand description
Maps between a Location
and a PointIndex
(and vice versa).
Fields§
§statements_before_block: IndexVec<BasicBlock, usize>
For each basic block, how many points are contained within?
basic_blocks: IndexVec<PointIndex, BasicBlock>
Map backward from each point to the basic block that it belongs to.
num_points: usize
Implementations§
source§impl RegionValueElements
impl RegionValueElements
pub(crate) fn new(body: &Body<'_>) -> Self
sourcepub(crate) fn num_points(&self) -> usize
pub(crate) fn num_points(&self) -> usize
Total number of point indices
sourcepub(crate) fn point_from_location(&self, location: Location) -> PointIndex
pub(crate) fn point_from_location(&self, location: Location) -> PointIndex
Converts a Location
into a PointIndex
. O(1).
sourcepub(crate) fn entry_point(&self, block: BasicBlock) -> PointIndex
pub(crate) fn entry_point(&self, block: BasicBlock) -> PointIndex
Converts a Location
into a PointIndex
. O(1).
sourcepub(crate) fn to_block_start(&self, index: PointIndex) -> PointIndex
pub(crate) fn to_block_start(&self, index: PointIndex) -> PointIndex
Return the PointIndex for the block start of this index.
sourcepub(crate) fn to_location(&self, index: PointIndex) -> Location
pub(crate) fn to_location(&self, index: PointIndex) -> Location
Converts a PointIndex
back to a location. O(1).
sourcepub(crate) fn point_in_range(&self, index: PointIndex) -> bool
pub(crate) fn point_in_range(&self, index: PointIndex) -> bool
Sometimes we get point-indices back from bitsets that may be out of range (because they round up to the nearest 2^N number of bits). Use this function to filter such points out if you like.
Auto Trait Implementations§
impl RefUnwindSafe for RegionValueElements
impl Send for RegionValueElements
impl Sync for RegionValueElements
impl Unpin for RegionValueElements
impl UnwindSafe for RegionValueElements
Blanket Implementations§
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: 56 bytes