Enum cranelift_codegen::ir::ArgumentLoc [−][src]
Function argument location.
The ABI specifies how arguments are passed to a function, and where return values appear after
the call. Just like a ValueLoc, function arguments can be passed in registers or on the
stack.
Function arguments on the stack are accessed differently for the incoming arguments to the current function and the outgoing arguments to a called external function. For this reason, the location of stack arguments is described as an offset into the array of function arguments on the stack.
An ArgumentLoc can be translated to a ValueLoc only when we know if we're talking about an
incoming argument or an outgoing argument.
- For stack arguments, different
StackSlotentities are used to represent incoming and outgoing arguments. - For register arguments, there is usually no difference, but if we ever add support for a register-window ISA like SPARC, register arguments would also need to be translated.
Variants
UnassignedThis argument has not been assigned to a location yet.
Reg(RegUnit)Argument is passed in a register.
Stack(i32)Argument is passed on the stack, at the given byte offset into the argument array.
Methods
impl ArgumentLoc[src]
impl ArgumentLocpub fn is_assigned(&self) -> bool[src]
pub fn is_assigned(&self) -> boolIs this an assigned location? (That is, not Unassigned).
pub fn is_reg(&self) -> bool[src]
pub fn is_reg(&self) -> boolIs this a register location?
pub fn is_stack(&self) -> bool[src]
pub fn is_stack(&self) -> boolIs this a stack location?
pub fn display<'a, R: Into<Option<&'a RegInfo>>>(
self,
regs: R
) -> DisplayArgumentLoc<'a>[src]
pub fn display<'a, R: Into<Option<&'a RegInfo>>>(
self,
regs: R
) -> DisplayArgumentLoc<'a>Return an object that can display this argument location, using the register info from the target ISA.
Trait Implementations
impl Copy for ArgumentLoc[src]
impl Copy for ArgumentLocimpl Clone for ArgumentLoc[src]
impl Clone for ArgumentLocfn clone(&self) -> ArgumentLoc[src]
fn clone(&self) -> ArgumentLocReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for ArgumentLoc[src]
impl Debug for ArgumentLocfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Eq for ArgumentLoc[src]
impl Eq for ArgumentLocimpl PartialEq for ArgumentLoc[src]
impl PartialEq for ArgumentLocfn eq(&self, other: &ArgumentLoc) -> bool[src]
fn eq(&self, other: &ArgumentLoc) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &ArgumentLoc) -> bool[src]
fn ne(&self, other: &ArgumentLoc) -> boolThis method tests for !=.
impl Hash for ArgumentLoc[src]
impl Hash for ArgumentLocfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Default for ArgumentLoc[src]
impl Default for ArgumentLocAuto Trait Implementations
impl Send for ArgumentLoc
impl Send for ArgumentLocimpl Sync for ArgumentLoc
impl Sync for ArgumentLoc