pub struct DomTree { /* private fields */ }Expand description
The dominator tree of a computation graph.
The tree is rooted at a virtual root node that is not part of the
original graph. Every real node has a unique immediate dominator, except
source nodes whose only dominator is the virtual root (represented by
idom(n) == None).
Implementations§
Source§impl DomTree
impl DomTree
Sourcepub fn idom(&self, node: NodeId) -> Option<NodeId>
pub fn idom(&self, node: NodeId) -> Option<NodeId>
Returns the immediate dominator of node, or None if it is a root.
Sourcepub fn children(&self, node: NodeId) -> &[NodeId]
pub fn children(&self, node: NodeId) -> &[NodeId]
Returns the children of node in the dominator tree.
Sourcepub fn roots(&self) -> Vec<NodeId>
pub fn roots(&self) -> Vec<NodeId>
Returns all root nodes (nodes with no immediate dominator in the real graph).
Sourcepub fn dominates(&self, dominator: NodeId, node: NodeId) -> bool
pub fn dominates(&self, dominator: NodeId, node: NodeId) -> bool
Returns true if dominator dominates node.
A node always dominates itself.
Sourcepub fn dominated_by(&self, root: NodeId) -> Vec<NodeId>
pub fn dominated_by(&self, root: NodeId) -> Vec<NodeId>
Returns the set of nodes dominated by root (its subtree), including root itself.
Trait Implementations§
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