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(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

impl ArgumentLoc[src]

pub fn is_assigned(self) -> bool[src]

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

pub fn is_reg(self) -> bool[src]

Is this a register location?

pub fn is_stack(self) -> bool[src]

Is this a stack location?

pub fn display<'a, R: Into<Option<&'a RegInfo>>>(
    self,
    regs: R
) -> DisplayArgumentLoc<'a>
[src]

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

Trait Implementations

impl Clone for ArgumentLoc[src]

fn clone(&self) -> ArgumentLoc[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ArgumentLoc[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for ArgumentLoc[src]

fn default() -> Self[src]

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

impl Hash for ArgumentLoc[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

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]

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

impl PartialEq<ArgumentLoc> for ArgumentLoc[src]

fn eq(&self, other: &ArgumentLoc) -> bool[src]

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

fn ne(&self, other: &ArgumentLoc) -> bool[src]

This method tests for !=.

impl Copy for ArgumentLoc[src]

impl Eq for ArgumentLoc[src]

impl StructuralEq for ArgumentLoc[src]

impl StructuralPartialEq for ArgumentLoc[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

pub fn equivalent(&self, key: &K) -> bool[src]

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

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

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

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.