pub(crate) struct InstructionBuilder {
Show 14 fields name: String, doc: String, format: Rc<InstructionFormat>, operands_in: Option<Vec<Operand>>, operands_out: Option<Vec<Operand>>, is_terminator: bool, is_branch: bool, is_call: bool, is_return: bool, can_load: bool, can_store: bool, can_trap: bool, other_side_effects: bool, side_effects_idempotent: bool,
}

Fields§

§name: String§doc: String§format: Rc<InstructionFormat>§operands_in: Option<Vec<Operand>>§operands_out: Option<Vec<Operand>>§is_terminator: bool§is_branch: bool§is_call: bool§is_return: bool§can_load: bool§can_store: bool§can_trap: bool§other_side_effects: bool§side_effects_idempotent: bool

Implementations§

source§

impl InstructionBuilder

source

pub fn new<S: Into<String>>( name: S, doc: S, format: &Rc<InstructionFormat> ) -> Self

source

pub fn operands_in(self, operands: Vec<Operand>) -> Self

source

pub fn operands_out(self, operands: Vec<Operand>) -> Self

source

pub fn terminates_block(self) -> Self

Mark this instruction as a block terminator.

source

pub fn branches(self) -> Self

Mark this instruction as a branch instruction. This also implies that the instruction is a block terminator.

source

pub fn call(self) -> Self

Mark this instruction as a call instruction.

source

pub fn returns(self) -> Self

Mark this instruction as a return instruction. This also implies that the instruction is a block terminator.

source

pub fn can_load(self) -> Self

Mark this instruction as one that can load from memory.

source

pub fn can_store(self) -> Self

Mark this instruction as one that can store to memory.

source

pub fn can_trap(self) -> Self

Mark this instruction as possibly trapping.

source

pub fn other_side_effects(self) -> Self

Mark this instruction as one that has side-effects.

source

pub fn side_effects_idempotent(self) -> Self

Mark this instruction as one whose side-effects may be de-duplicated.

source

fn build(self) -> Rc<InstructionContent>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.