pub enum Terminator {
NoTerminator,
ReturnVoid,
Return(Value),
Jump(BasicBlockId),
Branch(Value, BasicBlockId, BasicBlockId),
}
Expand description
Terminator
terminates a given basic block. For information on basic blocks, see
ModuleBuilder::push_block
.
Variants§
NoTerminator
No terminator has been added to the block yet. Note that compiling blocks with this as its terminator results in undefined behaviour.
ReturnVoid
The block ends with a return with no value.
Return(Value)
The block ends with a return with a value.
Jump(BasicBlockId)
The block ends with a jump to another block.
Branch(Value, BasicBlockId, BasicBlockId)
The block ends with a branch to two different blocks depending on the truthiness of the value. If the value is true, it jumps to the first block; otherwise, it jumps to the second block.
Trait Implementations§
Source§impl Clone for Terminator
impl Clone for Terminator
Source§fn clone(&self) -> Terminator
fn clone(&self) -> Terminator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Terminator
impl Debug for Terminator
Auto Trait Implementations§
impl Freeze for Terminator
impl RefUnwindSafe for Terminator
impl Send for Terminator
impl Sync for Terminator
impl Unpin for Terminator
impl UnwindSafe for Terminator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more