[][src]Struct gf::pivot::basic_block::UnsealedBasicBlockBuilder

pub struct UnsealedBasicBlockBuilder<'a> { /* fields omitted */ }

⚪ Builder for unsealed basic blocks that simplifies constructing common code patterns.

Implementations

impl<'a> UnsealedBasicBlockBuilder<'a>[src]

pub fn new(
    module_builder: &'a mut UnsealedModuleBuilder,
    root_basic_block: BasicBlockId
) -> Self
[src]

Create a builder.

Errors

  • Panics if the root basic block does not exist.
  • Panics if the root basic block is not a stub.

pub fn module_builder(&self) -> &UnsealedModuleBuilder[src]

Return a shared reference to the module builder.

pub fn module_builder_mut(&mut self) -> &mut UnsealedModuleBuilder[src]

Return a mutable reference to the module builder.

pub fn add_stmt<S: Into<UnsealedStmt>>(
    &mut self,
    basic_block: BasicBlockId,
    stmt: S
)
[src]

Add a statement at the end of a basic block.

Errors

  • Panics if the basic block is not managed by this builder.

pub fn add_split(&mut self, basic_block: BasicBlockId) -> BasicBlockId[src]

Terminate the basic block and start a new one as its successor.

The returned value in the successor ID.

Errors

  • Panics if the basic block is not managed by this builder.

pub fn add_if(
    &mut self,
    basic_block: BasicBlockId,
    branch_var: Var
) -> (BasicBlockId, BasicBlockId, BasicBlockId)
[src]

Add an if-then-else at the end of a basic block.

The three returned values are the “then,” the “else,” and the “join” basic blocks IDs.

Errors

  • Panics if the basic block is not managed by this builder.

pub fn add_while(
    &mut self,
    basic_block: BasicBlockId,
    branch_var: Var
) -> (BasicBlockId, BasicBlockId)
[src]

Add a while loop at the end of the basic block.

The two returned values are the “loop” and the “join” basic block IDs.

Errors

  • Panics if the basic block is not managed by this builder.

Trait Implementations

impl<'a> Debug for UnsealedBasicBlockBuilder<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for UnsealedBasicBlockBuilder<'a>

impl<'a> Send for UnsealedBasicBlockBuilder<'a>

impl<'a> Sync for UnsealedBasicBlockBuilder<'a>

impl<'a> Unpin for UnsealedBasicBlockBuilder<'a>

impl<'a> !UnwindSafe for UnsealedBasicBlockBuilder<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.