pub struct Value(pub Index);
Tuple Fields
0: Index
Implementations
sourceimpl Value
impl Value
sourcepub fn new_argument(
context: &mut Context,
ty: Type,
span_md_idx: Option<MetadataIndex>
) -> Value
pub fn new_argument(
context: &mut Context,
ty: Type,
span_md_idx: Option<MetadataIndex>
) -> Value
Return a new argument Value
.
sourcepub fn new_constant(
context: &mut Context,
constant: Constant,
span_md_idx: Option<MetadataIndex>
) -> Value
pub fn new_constant(
context: &mut Context,
constant: Constant,
span_md_idx: Option<MetadataIndex>
) -> Value
Return a new constant Value
.
sourcepub fn new_instruction(
context: &mut Context,
instruction: Instruction,
opt_span_md_idx: Option<MetadataIndex>
) -> Value
pub fn new_instruction(
context: &mut Context,
instruction: Instruction,
opt_span_md_idx: Option<MetadataIndex>
) -> Value
Return a new instruction Value
.
sourcepub fn is_constant(&self, context: &Context) -> bool
pub fn is_constant(&self, context: &Context) -> bool
Return whether this is a constant value.
sourcepub fn is_terminator(&self, context: &Context) -> bool
pub fn is_terminator(&self, context: &Context) -> bool
Return whether this value is an instruction, and specifically a ‘terminator’.
A terminator is always the last instruction in a block (and may not appear anywhere else) and is either a branch or return.
sourcepub fn replace_instruction_value(
&self,
context: &mut Context,
old_val: Value,
new_val: Value
)
pub fn replace_instruction_value(
&self,
context: &mut Context,
old_val: Value,
new_val: Value
)
If this value is an instruction and if any of its parameters is old_val
then replace them
with new_val
.
Trait Implementations
impl Copy for Value
impl Eq for Value
impl StructuralEq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more