pub enum Terminator {
Ret(Ret),
Br(Br),
CondBr(CondBr),
Switch(Switch),
IndirectBr(IndirectBr),
Invoke(Invoke),
Resume(Resume),
Unreachable(Unreachable),
CleanupRet(CleanupRet),
CatchRet(CatchRet),
CatchSwitch(CatchSwitch),
CallBr(CallBr),
}Expand description
Re-export from llvm-ir.
Terminator instructions end a basic block.
See LLVM 14 docs on Terminator Instructions
Variants§
Ret(Ret)
Br(Br)
CondBr(CondBr)
Switch(Switch)
IndirectBr(IndirectBr)
Invoke(Invoke)
Resume(Resume)
Unreachable(Unreachable)
CleanupRet(CleanupRet)
CatchRet(CatchRet)
CatchSwitch(CatchSwitch)
CallBr(CallBr)
Implementations§
Source§impl Terminator
impl Terminator
Sourcepub fn try_get_result(&self) -> Option<&Name>
pub fn try_get_result(&self) -> Option<&Name>
Get the result (destination) of the Terminator, or None if the
Terminator doesn’t have a result (has void type).
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 (const: unstable) · 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
Source§impl Display for Terminator
impl Display for Terminator
Source§impl From<Br> for Terminator
impl From<Br> for Terminator
Source§fn from(term: Br) -> Terminator
fn from(term: Br) -> Terminator
Converts to this type from the input type.
Source§impl From<CallBr> for Terminator
impl From<CallBr> for Terminator
Source§fn from(term: CallBr) -> Terminator
fn from(term: CallBr) -> Terminator
Converts to this type from the input type.
Source§impl From<CatchRet> for Terminator
impl From<CatchRet> for Terminator
Source§fn from(term: CatchRet) -> Terminator
fn from(term: CatchRet) -> Terminator
Converts to this type from the input type.
Source§impl From<CatchSwitch> for Terminator
impl From<CatchSwitch> for Terminator
Source§fn from(term: CatchSwitch) -> Terminator
fn from(term: CatchSwitch) -> Terminator
Converts to this type from the input type.
Source§impl From<CleanupRet> for Terminator
impl From<CleanupRet> for Terminator
Source§fn from(term: CleanupRet) -> Terminator
fn from(term: CleanupRet) -> Terminator
Converts to this type from the input type.
Source§impl From<CondBr> for Terminator
impl From<CondBr> for Terminator
Source§fn from(term: CondBr) -> Terminator
fn from(term: CondBr) -> Terminator
Converts to this type from the input type.
Source§impl From<IndirectBr> for Terminator
impl From<IndirectBr> for Terminator
Source§fn from(term: IndirectBr) -> Terminator
fn from(term: IndirectBr) -> Terminator
Converts to this type from the input type.
Source§impl From<Invoke> for Terminator
impl From<Invoke> for Terminator
Source§fn from(term: Invoke) -> Terminator
fn from(term: Invoke) -> Terminator
Converts to this type from the input type.
Source§impl From<Resume> for Terminator
impl From<Resume> for Terminator
Source§fn from(term: Resume) -> Terminator
fn from(term: Resume) -> Terminator
Converts to this type from the input type.
Source§impl From<Ret> for Terminator
impl From<Ret> for Terminator
Source§fn from(term: Ret) -> Terminator
fn from(term: Ret) -> Terminator
Converts to this type from the input type.
Source§impl From<Switch> for Terminator
impl From<Switch> for Terminator
Source§fn from(term: Switch) -> Terminator
fn from(term: Switch) -> Terminator
Converts to this type from the input type.
Source§impl From<Unreachable> for Terminator
impl From<Unreachable> for Terminator
Source§fn from(term: Unreachable) -> Terminator
fn from(term: Unreachable) -> Terminator
Converts to this type from the input type.
Source§impl HasDebugLoc for Terminator
impl HasDebugLoc for Terminator
Source§impl PartialEq for Terminator
impl PartialEq for Terminator
impl StructuralPartialEq for Terminator
Source§impl Typed for Terminator
The Type of a Terminator is its result type.
For most terminators, this is VoidType.
For instance, a Ret instruction has void type even if
the function returns a non-void value; we do not store the result of a Ret
instruction using something like %3 = ret i32 %2.
See LLVM 14 docs on Terminator Instructions
impl Typed for Terminator
The Type of a Terminator is its result type.
For most terminators, this is VoidType.
For instance, a Ret instruction has void type even if
the function returns a non-void value; we do not store the result of a Ret
instruction using something like %3 = ret i32 %2.
See LLVM 14 docs on Terminator Instructions
Auto Trait Implementations§
impl Freeze for Terminator
impl RefUnwindSafe for Terminator
impl Send for Terminator
impl Sync for Terminator
impl Unpin for Terminator
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more