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
ValueTypeinstance indicates an SSA value operand with a concrete type. -
A
TypeVarinstance indicates an SSA value operand, and the instruction is polymorphic over the possible concrete types that the type variable can assume. -
An
ImmediateKindinstance indicates an immediate operand whose value is encoded in the instruction itself rather than being passed as an SSA value. -
An
EntityRefKindinstance indicates an operand that references another entity in the function, typically something declared in the function preamble.
Fields§
§name: &'static strName of the operand variable, as it appears in function parameters, legalizations, etc.
kind: OperandKindType 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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Operand
impl !RefUnwindSafe for Operand
impl !Send for Operand
impl !Sync for Operand
impl Unpin for Operand
impl !UnwindSafe for Operand
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)