Skip to main content

DominatorTree

Struct DominatorTree 

Source
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>

Source

pub fn compute<D>(cfg: &PcodeCfg<N, D>) -> Self

Compute the dominator tree for cfg.

Source

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).

Source

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.

Source

pub fn dominates(&self, a: &N, b: &N) -> bool

Returns true if a dominates b (reflexive: a node dominates itself).

Source

pub fn strict_dominates(&self, a: &N, b: &N) -> bool

Returns true if a strictly dominates b (a dominates b and a != b).

Source

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>
where HashMap<N, Option<N>>: Freeze,

§

impl<N> RefUnwindSafe for DominatorTree<N>

§

impl<N> Send for DominatorTree<N>
where HashMap<N, Option<N>>: Send,

§

impl<N> Sync for DominatorTree<N>
where HashMap<N, Option<N>>: Sync,

§

impl<N> Unpin for DominatorTree<N>
where HashMap<N, Option<N>>: Unpin,

§

impl<N> UnsafeUnpin for DominatorTree<N>
where HashMap<N, Option<N>>: UnsafeUnpin,

§

impl<N> UnwindSafe for DominatorTree<N>
where HashMap<N, Option<N>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, A> IntoAst<A> for T
where T: Into<A>, A: Ast,

Source§

fn into_ast(self, _a: &A) -> A

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more