Skip to main content

InstructionMutRef

Type Alias InstructionMutRef 

Source
pub type InstructionMutRef<'str, 'ctx> = BaseRef<&'ctx mut Context<'str>, InstructionId>;

Aliased Type§

pub struct InstructionMutRef<'str, 'ctx> {
    pub id: InstructionId,
    /* private fields */
}

Fields§

§id: InstructionId

Implementations§

Source§

impl<'str, 'ctx> InstructionMutRef<'str, 'ctx>

Source

pub fn as_ref(&self) -> InstructionRef<'str, '_>

Source

pub fn inner_mut(&mut self) -> &mut Instruction<'str>

Source

pub fn mnemonic_mut(&mut self) -> &mut Mnemonic

Source

pub fn set_mnemonic(&mut self, mnemonic: Mnemonic)

Replace this instruction’s mnemonic while keeping the reverse use-def map in sync.

Source

pub fn address_mut(&mut self) -> &mut Option<u64>

Source

pub fn set_address(&mut self, address: u64)

Source

pub fn set_type(&mut self, new_type: TypeId)

Sets the type of this instruction’s result.

Panics if the instruction already has a type that is incompatible with new_type (same size but different kind).

Source

pub fn set_type_resized(&mut self, new_type: TypeId)

Sets the result type, allowing the byte size to change.

Unlike set_type, this does not enforce size invariance: it exists for transforms that legitimately resize an aggregate result, such as trimming dead fields from a returned write-set (dead_signature). Prefer set_type for any same-size retype.

Source

pub fn set_space(&mut self, space: SpaceId)

Sets the address-space provenance of this instruction’s result.

A non-register space promotes the result to a SpaceAddress of the same byte width. Register spaces are ignored (pointer arithmetic is not allowed in the register space).

Trait Implementations§

Source§

impl Display for InstructionMutRef<'_, '_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Named for InstructionMutRef<'_, '_>

Source§

fn name(&self) -> Option<&str>

Source§

impl<'str, 'ctx> Value<'str, 'ctx> for InstructionMutRef<'str, 'ctx>

Source§

fn id(&self) -> ValueId

The context-unique identifier for this value.
Source§

fn size(&self) -> usize

The size of this value’s output in bytes, or 0 for non-data values (terminators, blocks, functions).
Source§

impl<'s, 'ctx: 's, 'str: 'ctx> WithCtx<'s, 's, 'str> for InstructionMutRef<'str, 'ctx>

Source§

fn ctx(&'s self) -> &'s Context<'str>

Source§

impl<'s, 'ctx: 's, 'str: 'ctx> WithCtxMut<'s, 'str> for InstructionMutRef<'str, 'ctx>

Source§

fn ctx_mut(&'s mut self) -> &'s mut Context<'str>