[−][src]Struct gf::pivot::basic_block::UnsealedBasicBlockBuilder
⚪ 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]
module_builder: &'a mut UnsealedModuleBuilder,
root_basic_block: BasicBlockId
) -> Self
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]
&mut self,
basic_block: BasicBlockId,
stmt: S
)
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]
&mut self,
basic_block: BasicBlockId,
branch_var: Var
) -> (BasicBlockId, BasicBlockId, BasicBlockId)
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]
&mut self,
basic_block: BasicBlockId,
branch_var: Var
) -> (BasicBlockId, BasicBlockId)
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]
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>,