pub struct DominatorTree {
pub idom: Vec<Option<usize>>,
pub children: Vec<Vec<usize>>,
/* private fields */
}Expand description
Immediate dominators, constant-time dominance, and logarithmic LCA queries.
Fields§
§idom: Vec<Option<usize>>§children: Vec<Vec<usize>>Implementations§
Source§impl DominatorTree
impl DominatorTree
Sourcepub fn compute(successors: &[Vec<usize>], root: usize) -> Result<Self, CfgError>
pub fn compute(successors: &[Vec<usize>], root: usize) -> Result<Self, CfgError>
Compute dominance without constructing loop, SCC, or frontier tables.
Vertices unreachable from root have no dominance interval.
Sourcepub fn from_idom(
idom: Vec<Option<usize>>,
root: usize,
) -> Result<Self, CfgError>
pub fn from_idom( idom: Vec<Option<usize>>, root: usize, ) -> Result<Self, CfgError>
Construct dominance intervals from an independently supplied idom tree.
pub fn dominates(&self, dominator: usize, block: usize) -> bool
Sourcepub fn depth(&self, block: usize) -> Option<usize>
pub fn depth(&self, block: usize) -> Option<usize>
Distance from the root, or None for an unreachable or unknown block.
pub fn lca(&self, left: usize, right: usize) -> Option<usize>
Trait Implementations§
Source§impl Clone for DominatorTree
impl Clone for DominatorTree
Source§impl Debug for DominatorTree
impl Debug for DominatorTree
impl Eq for DominatorTree
Source§impl PartialEq for DominatorTree
impl PartialEq for DominatorTree
impl StructuralPartialEq for DominatorTree
Auto Trait Implementations§
impl Freeze for DominatorTree
impl RefUnwindSafe for DominatorTree
impl Send for DominatorTree
impl Sync for DominatorTree
impl Unpin for DominatorTree
impl UnsafeUnpin for DominatorTree
impl UnwindSafe for DominatorTree
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