pub struct DominatorFinder<'a, N> { /* private fields */ }Expand description
Calculates the dominators in a flow graph. Also has a method for finding the closest common dominator of a set of nodes.
Implementations§
Source§impl<'a, N> DominatorFinder<'a, N>
impl<'a, N> DominatorFinder<'a, N>
Sourcepub fn calculate(
flow_graph: &'a FlowGraph<N>,
) -> Result<Self, DominatorFinderError>
pub fn calculate( flow_graph: &'a FlowGraph<N>, ) -> Result<Self, DominatorFinderError>
Constructs a new DominatorFinder. Returns an error if the flow graph is invalid: e.g. if some node is unreachable from the start node.
Sourcepub fn get_immediate_dominators(&self) -> HashMap<N, N>
pub fn get_immediate_dominators(&self) -> HashMap<N, N>
Returns a map from each node to its immediate dominator. NOTE: the immediate dominator of the start node is itself.
Sourcepub fn find_closest_common_dominator<NI>(
&self,
target_set: NI,
) -> Result<N, DominatorFinderError>where
NI: IntoIterator<Item = N>,
pub fn find_closest_common_dominator<NI>(
&self,
target_set: NI,
) -> Result<N, DominatorFinderError>where
NI: IntoIterator<Item = N>,
Finds the closest common dominator for the given flow graph and set of nodes S (target_set).
Auto Trait Implementations§
impl<'a, N> Freeze for DominatorFinder<'a, N>
impl<'a, N> RefUnwindSafe for DominatorFinder<'a, N>where
N: RefUnwindSafe,
impl<'a, N> Send for DominatorFinder<'a, N>where
N: Sync,
impl<'a, N> Sync for DominatorFinder<'a, N>where
N: Sync,
impl<'a, N> Unpin for DominatorFinder<'a, N>
impl<'a, N> UnsafeUnpin for DominatorFinder<'a, N>
impl<'a, N> UnwindSafe for DominatorFinder<'a, N>where
N: RefUnwindSafe,
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