Struct cranelift_codegen_meta::cdsl::operands::Operand
source · pub(crate) struct Operand {
pub name: &'static str,
pub kind: OperandKind,
doc: Option<&'static str>,
}
Expand description
An instruction operand can be an immediate, an SSA value, or an entity reference. The type of the operand is one of:
-
A
ValueType
instance indicates an SSA value operand with a concrete type. -
A
TypeVar
instance indicates an SSA value operand, and the instruction is polymorphic over the possible concrete types that the type variable can assume. -
An
ImmediateKind
instance indicates an immediate operand whose value is encoded in the instruction itself rather than being passed as an SSA value. -
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>
Implementations§
source§impl Operand
impl Operand
pub fn new(name: &'static str, kind: impl Into<OperandKind>) -> Self
pub fn with_doc(self, doc: &'static str) -> Self
pub fn doc(&self) -> &str
pub fn is_value(&self) -> bool
pub fn type_var(&self) -> Option<&TypeVar>
pub fn is_varargs(&self) -> bool
sourcepub fn is_immediate_or_entityref(&self) -> bool
pub fn is_immediate_or_entityref(&self) -> bool
Returns true if the operand has an immediate kind or is an EntityRef.
sourcepub fn is_immediate(&self) -> bool
pub fn is_immediate(&self) -> bool
Returns true if the operand has an immediate kind.