LoopTree

Struct LoopTree 

Source
pub struct LoopTree { /* private fields */ }

Implementations§

Source§

impl LoopTree

Source

pub fn new() -> Self

Source

pub fn compute(&mut self, cfg: &ControlFlowGraph, domtree: &DomTree)

Compute the LoopTree of the block.

Source

pub fn loops(&self) -> impl DoubleEndedIterator<Item = Loop>

Returns all loops. The result iterator guarantees outer loops are returned before its inner loops.

Source

pub fn iter_blocks_post_order<'a, 'b>( &'a self, cfg: &'b ControlFlowGraph, lp: Loop, ) -> BlocksInLoopPostOrder<'a, 'b>

Returns all blocks in the loop.

Source

pub fn is_in_loop(&self, block: Block, lp: Loop) -> bool

Returns true if the block is in the lp.

Source

pub fn loop_num(&self) -> usize

Returns number of loops found.

Source

pub fn map_block(&mut self, block: Block, lp: Loop)

Map block to lp.

Source

pub fn clear(&mut self)

Clear the internal state of LoopTree.

Source

pub fn loop_header(&self, lp: Loop) -> Block

Returns header block of the lp.

Source

pub fn parent_loop(&self, lp: Loop) -> Option<Loop>

Get parent loop of the lp if exists.

Source

pub fn loop_of_block(&self, block: Block) -> Option<Loop>

Returns the loop that the block belongs to. If the block belongs to multiple loops, then returns the innermost loop.

Trait Implementations§

Source§

impl Debug for LoopTree

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LoopTree

Source§

fn default() -> LoopTree

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.