Enum cranelift_codegen::machinst::abi_impl::ABIArg[][src]

pub enum ABIArg {
    Slots {
        slots: Vec<ABIArgSlot>,
        purpose: ArgumentPurpose,
    },
    StructArg {
        offset: i64,
        size: u64,
        purpose: ArgumentPurpose,
    },
}
Expand description

An ABIArg is composed of one or more parts. This allows for a CLIF-level Value to be passed with its parts in more than one location at the ABI level. For example, a 128-bit integer may be passed in two 64-bit registers, or even a 64-bit register and a 64-bit stack slot, on a 64-bit machine. The number of “parts” should correspond to the number of registers used to store this type according to the machine backend.

As an invariant, the purpose for every part must match. As a further invariant, a StructArg part cannot appear with any other part.

Variants

Slots

Storage slots (registers or stack locations) for each part of the argument value. The number of slots must equal the number of register parts used to store a value of this type.

Show fields

Fields of Slots

slots: Vec<ABIArgSlot>

Slots, one per register part.

purpose: ArgumentPurpose

Purpose of this arg.

StructArg

Structure argument. We reserve stack space for it, but the CLIF-level semantics are a little weird: the value passed to the call instruction, and received in the corresponding block param, is a pointer. On the caller side, we memcpy the data from the passed-in pointer to the stack area; on the callee side, we compute a pointer to this stack area and provide that as the argument’s value.

Show fields

Fields of StructArg

offset: i64

Offset of this arg relative to base of stack args.

size: u64

Size of this arg on the stack.

purpose: ArgumentPurpose

Purpose of this arg.

Implementations

impl ABIArg[src]

pub fn reg(
    reg: RealReg,
    ty: Type,
    extension: ArgumentExtension,
    purpose: ArgumentPurpose
) -> ABIArg
[src]

Create an ABIArg from one register.

pub fn stack(
    offset: i64,
    ty: Type,
    extension: ArgumentExtension,
    purpose: ArgumentPurpose
) -> ABIArg
[src]

Create an ABIArg from one stack slot.

Trait Implementations

impl Clone for ABIArg[src]

fn clone(&self) -> ABIArg[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 ABIArg[src]

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl RefUnwindSafe for ABIArg

impl Send for ABIArg

impl Sync for ABIArg

impl Unpin for ABIArg

impl UnwindSafe for ABIArg

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