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.
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)