Struct rustc_mir_transform::coverage::graph::CoverageGraph
source · pub(super) struct CoverageGraph {
bcbs: IndexVec<BasicCoverageBlock, BasicCoverageBlockData>,
bb_to_bcb: IndexVec<BasicBlock, Option<BasicCoverageBlock>>,
pub successors: IndexVec<BasicCoverageBlock, Vec<BasicCoverageBlock>>,
pub predecessors: IndexVec<BasicCoverageBlock, Vec<BasicCoverageBlock>>,
dominators: Option<Dominators<BasicCoverageBlock>>,
}
Expand description
A coverage-specific simplification of the MIR control flow graph (CFG). The CoverageGraph
s
nodes are BasicCoverageBlock
s, which encompass one or more MIR BasicBlock
s.
Fields§
§bcbs: IndexVec<BasicCoverageBlock, BasicCoverageBlockData>
§bb_to_bcb: IndexVec<BasicBlock, Option<BasicCoverageBlock>>
§successors: IndexVec<BasicCoverageBlock, Vec<BasicCoverageBlock>>
§predecessors: IndexVec<BasicCoverageBlock, Vec<BasicCoverageBlock>>
§dominators: Option<Dominators<BasicCoverageBlock>>
Implementations§
source§impl CoverageGraph
impl CoverageGraph
pub fn from_mir(mir_body: &Body<'_>) -> Self
fn compute_basic_coverage_blocks( mir_body: &Body<'_> ) -> (IndexVec<BasicCoverageBlock, BasicCoverageBlockData>, IndexVec<BasicBlock, Option<BasicCoverageBlock>>)
fn add_basic_coverage_block( bcbs: &mut IndexVec<BasicCoverageBlock, BasicCoverageBlockData>, bb_to_bcb: &mut IndexSlice<BasicBlock, Option<BasicCoverageBlock>>, basic_blocks: Vec<BasicBlock> )
pub fn iter_enumerated( &self ) -> impl Iterator<Item = (BasicCoverageBlock, &BasicCoverageBlockData)>
pub fn bcb_from_bb(&self, bb: BasicBlock) -> Option<BasicCoverageBlock>
pub fn dominates( &self, dom: BasicCoverageBlock, node: BasicCoverageBlock ) -> bool
pub fn cmp_in_dominator_order( &self, a: BasicCoverageBlock, b: BasicCoverageBlock ) -> Ordering
Trait Implementations§
source§impl Debug for CoverageGraph
impl Debug for CoverageGraph
source§impl DirectedGraph for CoverageGraph
impl DirectedGraph for CoverageGraph
type Node = BasicCoverageBlock
source§impl<'graph> GraphPredecessors<'graph> for CoverageGraph
impl<'graph> GraphPredecessors<'graph> for CoverageGraph
type Item = BasicCoverageBlock
type Iter = Copied<Iter<'graph, BasicCoverageBlock>>
source§impl<'graph> GraphSuccessors<'graph> for CoverageGraph
impl<'graph> GraphSuccessors<'graph> for CoverageGraph
type Item = BasicCoverageBlock
type Iter = Cloned<Iter<'graph, BasicCoverageBlock>>
source§impl Index<BasicCoverageBlock> for CoverageGraph
impl Index<BasicCoverageBlock> for CoverageGraph
§type Output = BasicCoverageBlockData
type Output = BasicCoverageBlockData
The returned type after indexing.
source§fn index(&self, index: BasicCoverageBlock) -> &BasicCoverageBlockData
fn index(&self, index: BasicCoverageBlock) -> &BasicCoverageBlockData
Performs the indexing (
container[index]
) operation. Read moresource§impl IndexMut<BasicCoverageBlock> for CoverageGraph
impl IndexMut<BasicCoverageBlock> for CoverageGraph
source§fn index_mut(
&mut self,
index: BasicCoverageBlock
) -> &mut BasicCoverageBlockData
fn index_mut( &mut self, index: BasicCoverageBlock ) -> &mut BasicCoverageBlockData
Performs the mutable indexing (
container[index]
) operation. Read moresource§impl WithNumNodes for CoverageGraph
impl WithNumNodes for CoverageGraph
source§impl WithPredecessors for CoverageGraph
impl WithPredecessors for CoverageGraph
fn predecessors( &self, node: Self::Node ) -> <Self as GraphPredecessors<'_>>::Iter
source§impl WithStartNode for CoverageGraph
impl WithStartNode for CoverageGraph
fn start_node(&self) -> Self::Node
source§impl WithSuccessors for CoverageGraph
impl WithSuccessors for CoverageGraph
fn successors(&self, node: Self::Node) -> <Self as GraphSuccessors<'_>>::Iter
fn depth_first_search(&self, from: Self::Node) -> DepthFirstSearch<'_, Self>where Self: WithNumNodes,
Auto Trait Implementations§
impl RefUnwindSafe for CoverageGraph
impl Send for CoverageGraph
impl Sync for CoverageGraph
impl Unpin for CoverageGraph
impl UnwindSafe for CoverageGraph
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
Mutably borrows from an owned value. Read more
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: 176 bytes