Enum cranelift_codegen::ir::ArgumentLoc
source · Expand description
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
StackSlot
entities 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§
Unassigned
This 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.
Implementations§
source§impl ArgumentLoc
impl ArgumentLoc
sourcepub fn is_assigned(self) -> bool
pub fn is_assigned(self) -> bool
Is this an assigned location? (That is, not Unassigned
).
Trait Implementations§
source§impl Clone for ArgumentLoc
impl Clone for ArgumentLoc
source§fn clone(&self) -> ArgumentLoc
fn clone(&self) -> ArgumentLoc
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more