#[non_exhaustive]pub enum BlockArg {
Value(Value),
Result(u32),
Exception,
ErrorCode,
}Expand description
An argument passed along a control-flow edge to a block parameter.
Besides ordinary values, the edges of invoke and check terminators can pass
what the terminator itself produces, which is not an SSA value before the edge
is taken:
| Argument | Valid on | Meaning |
|---|---|---|
Result(i) | invoke normal edge; check normal edge (i = 0) | the i-th result (returns, then relocated refs) |
Result(i) | invoke unwind edge, i >= returns | a relocated ref |
Exception | invoke unwind edge | the exception payload (ptr) |
ErrorCode | check error edge | the OPS error code (u32) |
§Examples
use ir_lang::{BlockArg, Value};
let a: BlockArg = Value::from_u32(3).into();
assert_eq!(a, BlockArg::Value(Value::from_u32(3)));
assert_eq!(BlockArg::Result(1).to_string(), "res1");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.
Value(Value)
An SSA value.
Result(u32)
A result of the invoke or check terminator.
Exception
The exception payload of an invoke’s unwind edge.
ErrorCode
The error code of a check’s error edge.
Trait Implementations§
impl Copy for BlockArg
impl Eq for BlockArg
impl StructuralPartialEq for BlockArg
Auto Trait Implementations§
impl Freeze for BlockArg
impl RefUnwindSafe for BlockArg
impl Send for BlockArg
impl Sync for BlockArg
impl Unpin for BlockArg
impl UnsafeUnpin for BlockArg
impl UnwindSafe for BlockArg
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