#[non_exhaustive]pub enum InstKind {
Plain,
Copy,
ParallelCopy,
Jump,
Branch,
Return,
Call,
Trap,
}Expand description
What an instruction does to control flow, and which generic handling it gets.
§Examples
use backend_lang::target::InstKind;
use backend_lang::x86_64::{self, op};
assert_eq!(x86_64::TARGET.inst(op::JMP).unwrap().kind(), InstKind::Jump);
assert!(InstKind::Jump.is_terminator());
assert!(!InstKind::Call.is_terminator());Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Plain
An ordinary instruction; control falls through.
Copy
ParallelCopy
Jump
An unconditional branch to one block, passing arguments.
Branch
A two-way conditional branch: a condition, then the taken and the not-taken block, each with arguments.
Return
A return from the function (the epilogue runs first).
Call
A call; control comes back to the next instruction.
Trap
An instruction that never falls through and never returns (ud2).
Implementations§
Trait Implementations§
impl Copy for InstKind
impl Eq for InstKind
impl StructuralPartialEq for InstKind
Auto Trait Implementations§
impl Freeze for InstKind
impl RefUnwindSafe for InstKind
impl Send for InstKind
impl Sync for InstKind
impl Unpin for InstKind
impl UnsafeUnpin for InstKind
impl UnwindSafe for InstKind
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