Struct LoopTree

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

Implementations§

Source§

impl LoopTree

Source

pub fn compute(cfg: &ControlFlowGraph, domtree: &DomTree) -> Self

Source

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

Returns all blocks in the loop.

Source

pub fn loops(&self) -> impl Iterator<Item = LoopId> + '_

Returns all loops in a function body. An outer loop is guaranteed to be iterated before its inner loops.

Source

pub fn loop_num(&self) -> usize

Returns number of loops found.

Source

pub fn is_block_in_loop(&self, block: BasicBlockId, lp: LoopId) -> bool

Returns true if the block is in the lp.

Source

pub fn loop_header(&self, lp: LoopId) -> BasicBlockId

Returns header block of the lp.

Source

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

Get parent loop of the lp if exists.

Source

pub fn loop_of_block(&self, block: BasicBlockId) -> Option<LoopId>

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

Trait Implementations§

Source§

impl Clone for LoopTree

Source§

fn clone(&self) -> LoopTree

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.