Enum cranelift_codegen::ir::ArgumentLoc[][src]

pub enum ArgumentLoc {
    Unassigned,
    Reg(RegUnit),
    Stack(i32),
}
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

Argument is passed in a register.

Tuple Fields of Reg

0: RegUnit
Stack

Argument is passed on the stack, at the given byte offset into the argument array.

Tuple Fields of Stack

0: i32

Implementations

Is this an assigned location? (That is, not Unassigned).

Is this a register location?

Is this a stack location?

Return an object that can display this argument location, using the register info from the target ISA.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.