pub struct DomTree { /* private fields */ }Expand description
Dominator tree for a single function.
idom[i] is the immediate dominator of block i. The entry block’s
entry is None (it has no dominator).
Implementations§
Source§impl DomTree
impl DomTree
Sourcepub fn compute(func: &Function, cfg: &Cfg) -> Self
pub fn compute(func: &Function, cfg: &Cfg) -> Self
Compute the dominator tree using the Cooper/Harvey/Kennedy iterative algorithm on the RPO-numbered CFG.
Sourcepub fn idom(&self, bid: BlockId) -> Option<BlockId>
pub fn idom(&self, bid: BlockId) -> Option<BlockId>
Immediate dominator of bid. Returns None for the entry block and
for blocks unreachable from entry.
Sourcepub fn dominates(&self, a: BlockId, b: BlockId) -> bool
pub fn dominates(&self, a: BlockId, b: BlockId) -> bool
Returns true if block a dominates block b.
Every block dominates itself.
Sourcepub fn strictly_dominates(&self, a: BlockId, b: BlockId) -> bool
pub fn strictly_dominates(&self, a: BlockId, b: BlockId) -> bool
Returns true if block a strictly dominates block b
(dominates but is not equal to b).
Auto Trait Implementations§
impl Freeze for DomTree
impl RefUnwindSafe for DomTree
impl Send for DomTree
impl Sync for DomTree
impl Unpin for DomTree
impl UnsafeUnpin for DomTree
impl UnwindSafe for DomTree
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