[][src]Struct cranelift_codegen_meta::cdsl::operands::Operand

pub(crate) struct Operand {
    pub name: &'static str,
    pub kind: OperandKind,
    doc: Option<&'static str>,
}

An instruction operand can be an immediate, an SSA value, or an entity reference. The type of the operand is one of:

  1. A ValueType instance indicates an SSA value operand with a concrete type.

  2. A TypeVar instance indicates an SSA value operand, and the instruction is polymorphic over the possible concrete types that the type variable can assume.

  3. An ImmediateKind instance indicates an immediate operand whose value is encoded in the instruction itself rather than being passed as an SSA value.

  4. An EntityRefKind instance indicates an operand that references another entity in the function, typically something declared in the function preamble.

Fields

name: &'static str

Name of the operand variable, as it appears in function parameters, legalizations, etc.

kind: OperandKind

Type of the operand.

doc: Option<&'static str>

Methods

impl Operand[src]

pub fn new(name: &'static str, kind: impl Into<OperandKind>) -> Self[src]

pub fn with_doc(self, doc: &'static str) -> Self[src]

pub fn doc(&self) -> Option<&str>[src]

pub fn is_value(&self) -> bool[src]

pub fn type_var(&self) -> Option<&TypeVar>[src]

pub fn is_varargs(&self) -> bool[src]

pub fn is_immediate_or_entityref(&self) -> bool[src]

Returns true if the operand has an immediate kind or is an EntityRef.

pub fn is_immediate(&self) -> bool[src]

Returns true if the operand has an immediate kind.

pub fn is_cpu_flags(&self) -> bool[src]

Trait Implementations

impl Clone for Operand[src]

impl Debug for Operand[src]

Auto Trait Implementations

impl !RefUnwindSafe for Operand

impl !Send for Operand

impl !Sync for Operand

impl Unpin for Operand

impl !UnwindSafe for Operand

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.