[−][src]Struct llvm_ir_analysis::DominatorTree
The dominator tree for a particular function.
To construct a DominatorTree
, use
FunctionAnalysis
, which you can get
from ModuleAnalysis
.
Implementations
impl<'m> DominatorTree<'m>
[src]
pub fn idom(&self, block: &'m Name) -> Option<&'m Name>
[src]
Get the immediate dominator of the basic block with the given Name
.
This will be None
for the entry block or for any unreachable blocks,
and Some
for all other blocks.
A block bbX is the immediate dominator of bbY if and only if:
- bbX strictly dominates bbY, i.e., bbX appears on every control-flow path from the entry block to bbY (but bbX =/= bbY)
- Of the blocks that strictly dominate bbY, bbX is the closest to bbY (farthest from entry) along paths from the entry block to bbY
pub fn idom_of_return(&self) -> &'m Name
[src]
Get the immediate dominator of CFGNode::Return
.
This will be the block bbX such that:
- bbX strictly dominates
CFGNode::Return
, i.e., bbX appears on every control-flow path through the function (but bbX =/=CFGNode::Return
) - Of the blocks that strictly dominate
CFGNode::Return
, bbX is the closest toCFGNode::Return
(farthest from entry) along paths through the function
pub fn children<'s>(
&'s self,
block: &'m Name
) -> impl Iterator<Item = CFGNode<'m>> + 's
[src]
&'s self,
block: &'m Name
) -> impl Iterator<Item = CFGNode<'m>> + 's
Get the children of the given basic block in the dominator tree, i.e.,
get all the blocks which are immediately dominated by block
.
See notes on idom()
.
pub fn dominates(&self, node_a: CFGNode<'m>, node_b: CFGNode<'m>) -> bool
[src]
Does node_a
dominate node_b
?
Note that every node dominates itself by definition, so if
node_a == node_b
, this returns true
.
See also strictly_dominates()
pub fn strictly_dominates(
&self,
node_a: CFGNode<'m>,
node_b: CFGNode<'m>
) -> bool
[src]
&self,
node_a: CFGNode<'m>,
node_b: CFGNode<'m>
) -> bool
Does node_a
strictly dominate node_b
?
This is the same as dominates()
, except that if
node_a == node_b
, this returns false
.
pub fn entry(&self) -> &'m Name
[src]
Get the Name
of the entry block for the function
Auto Trait Implementations
impl<'m> RefUnwindSafe for DominatorTree<'m>
impl<'m> Send for DominatorTree<'m>
impl<'m> Sync for DominatorTree<'m>
impl<'m> Unpin for DominatorTree<'m>
impl<'m> UnwindSafe for DominatorTree<'m>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,