pub struct Dominators { /* private fields */ }Expand description
Which block every path from the entry has to pass through to reach another.
Implementations§
Source§impl Dominators
impl Dominators
Sourcepub fn new(cfg: &Cfg) -> Self
pub fn new(cfg: &Cfg) -> Self
Builds the tree from the graph.
A function with no blocks gives a tree that reaches nothing, and every query against it answers no, which is what a caller handed a declaration should see.
Sourcepub fn dominates(&self, of: Block, block: Block) -> bool
pub fn dominates(&self, of: Block, block: Block) -> bool
Whether every path from the entry to block goes through of.
A block dominates itself. Both ends have to be blocks control reaches, and an unreachable one dominates nothing and is dominated by nothing.
Sourcepub fn strictly_dominates(&self, of: Block, block: Block) -> bool
pub fn strictly_dominates(&self, of: Block, block: Block) -> bool
The same, without a block dominating itself.
Sourcepub fn immediate_dominator(&self, block: Block) -> Option<Block>
pub fn immediate_dominator(&self, block: Block) -> Option<Block>
The nearest block that dominates this one and is not it.
None for the entry, which has no dominator above it, and for a block control does not
reach.
Trait Implementations§
Source§impl Clone for Dominators
impl Clone for Dominators
Source§fn clone(&self) -> Dominators
fn clone(&self) -> Dominators
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Dominators
impl Debug for Dominators
impl Eq for Dominators
Source§impl PartialEq for Dominators
impl PartialEq for Dominators
impl StructuralPartialEq for Dominators
Auto Trait Implementations§
impl Freeze for Dominators
impl RefUnwindSafe for Dominators
impl Send for Dominators
impl Sync for Dominators
impl Unpin for Dominators
impl UnsafeUnpin for Dominators
impl UnwindSafe for Dominators
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