#[non_exhaustive]pub enum ValueDef {
Param {
block: Block,
index: u32,
},
Result {
inst: Inst,
index: u32,
},
Detached,
}Expand description
Where a value comes from.
§Examples
use ir_lang::{Linkage, Module, Signature, Type, ValueDef};
let mut m = Module::new("demo");
let f = m.declare_function("f", &Signature::new(&[Type::I32], &[]), Linkage::Export)?;
let b = m.build(f)?;
let x = b.param(0)?;
assert_eq!(b.func().value_def(x), Some(ValueDef::Param { block: b.func().entry(), index: 0 }));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.
Param
The index-th parameter of block.
Result
The index-th result of inst.
Detached
No longer defined: its instruction or block was removed, or its block parameter was removed. Using a detached value is a validation error.
Trait Implementations§
impl Copy for ValueDef
impl Eq for ValueDef
impl StructuralPartialEq for ValueDef
Auto Trait Implementations§
impl Freeze for ValueDef
impl RefUnwindSafe for ValueDef
impl Send for ValueDef
impl Sync for ValueDef
impl Unpin for ValueDef
impl UnsafeUnpin for ValueDef
impl UnwindSafe for ValueDef
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