cranelift_codegen_meta::cdsl::instructions

Struct InstructionBuilder

Source
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>,

Source§

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>,

Source§

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.