pub struct Instr<'a>(/* private fields */);
Expand description
Instruction value
Implementations§
Source§impl<'a> Instr<'a>
impl<'a> Instr<'a>
Sourcepub fn parent(self) -> Result<BasicBlock<'a>, Error>
pub fn parent(self) -> Result<BasicBlock<'a>, Error>
Get the parent block
Sourcepub fn next_instruction(self) -> Result<Instr<'a>, Error>
pub fn next_instruction(self) -> Result<Instr<'a>, Error>
Get the next instruction
Sourcepub fn prev_instruction(self) -> Result<Instr<'a>, Error>
pub fn prev_instruction(self) -> Result<Instr<'a>, Error>
Get the previous instruction
Sourcepub fn remove_from_parent(self)
pub fn remove_from_parent(self)
Remove an instruction from its parent
Sourcepub fn has_metadata(self) -> bool
pub fn has_metadata(self) -> bool
Returns true when an instruction has associated metadata
Sourcepub fn set_metadata(self, id: u32, meta: Metadata<'a>)
pub fn set_metadata(self, id: u32, meta: Metadata<'a>)
Set associated metadata
Sourcepub fn num_successors(self) -> usize
pub fn num_successors(self) -> usize
Get number of successors
Sourcepub fn set_successor(&mut self, index: usize, bb: BasicBlock<'a>)
pub fn set_successor(&mut self, index: usize, bb: BasicBlock<'a>)
Set a successor block
Sourcepub fn is_conditional(self) -> bool
pub fn is_conditional(self) -> bool
Returns true if the instruction is conditional
Sourcepub fn set_condition(&mut self, cond: impl AsRef<Value<'a>>)
pub fn set_condition(&mut self, cond: impl AsRef<Value<'a>>)
Set the condition of a conditional
Trait Implementations§
impl<'a> Copy for Instr<'a>
Auto Trait Implementations§
impl<'a> Freeze for Instr<'a>
impl<'a> RefUnwindSafe for Instr<'a>
impl<'a> !Send for Instr<'a>
impl<'a> !Sync for Instr<'a>
impl<'a> Unpin for Instr<'a>
impl<'a> UnwindSafe for Instr<'a>
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