pub struct DominatorTree<N: CfgNode> { /* private fields */ }Expand description
Immediate-dominator tree for a PcodeCfg.
idom[n] = Some(d) means d is the unique immediate dominator of n.
idom[n] = None means n is an entry node.
Unreachable nodes are absent from the map.
Implementations§
Source§impl<N: CfgNode> DominatorTree<N>
impl<N: CfgNode> DominatorTree<N>
Sourcepub fn immediate_dominator(&self, node: &N) -> Option<&N>
pub fn immediate_dominator(&self, node: &N) -> Option<&N>
Return the immediate dominator of node, or None for entry nodes.
Returns None for unreachable nodes (not present in the tree).
Sourcepub fn dominators<'a>(&'a self, node: &'a N) -> impl Iterator<Item = &'a N>
pub fn dominators<'a>(&'a self, node: &'a N) -> impl Iterator<Item = &'a N>
Iterate over all dominators of node (inclusive), walking up the idom chain.
Sourcepub fn dominates(&self, a: &N, b: &N) -> bool
pub fn dominates(&self, a: &N, b: &N) -> bool
Returns true if a dominates b (reflexive: a node dominates itself).
Sourcepub fn strict_dominates(&self, a: &N, b: &N) -> bool
pub fn strict_dominates(&self, a: &N, b: &N) -> bool
Returns true if a strictly dominates b (a dominates b and a != b).
Sourcepub fn dominance_frontier<D>(
&self,
node: &N,
cfg: &PcodeCfg<N, D>,
) -> HashSet<N>
pub fn dominance_frontier<D>( &self, node: &N, cfg: &PcodeCfg<N, D>, ) -> HashSet<N>
Compute the dominance frontier of node.
DF(n) = { y | ∃ predecessor p of y such that n dominates p, and n does not strictly dominate y }.
Auto Trait Implementations§
impl<N> Freeze for DominatorTree<N>
impl<N> RefUnwindSafe for DominatorTree<N>
impl<N> Send for DominatorTree<N>
impl<N> Sync for DominatorTree<N>
impl<N> Unpin for DominatorTree<N>
impl<N> UnsafeUnpin for DominatorTree<N>
impl<N> UnwindSafe for DominatorTree<N>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more