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
sourceimpl 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
sourceimpl Clone for ArgumentLoc
impl Clone for ArgumentLoc
sourcefn clone(&self) -> ArgumentLoc
fn clone(&self) -> ArgumentLoc
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ArgumentLoc
impl Debug for ArgumentLoc
sourceimpl Default for ArgumentLoc
impl Default for ArgumentLoc
sourceimpl<'de> Deserialize<'de> for ArgumentLoc
impl<'de> Deserialize<'de> for ArgumentLoc
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Hash for ArgumentLoc
impl Hash for ArgumentLoc
sourceimpl PartialEq<ArgumentLoc> for ArgumentLoc
impl PartialEq<ArgumentLoc> for ArgumentLoc
sourcefn eq(&self, other: &ArgumentLoc) -> bool
fn eq(&self, other: &ArgumentLoc) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ArgumentLoc) -> bool
fn ne(&self, other: &ArgumentLoc) -> bool
This method tests for !=
.
sourceimpl Serialize for ArgumentLoc
impl Serialize for ArgumentLoc
impl Copy for ArgumentLoc
impl Eq for ArgumentLoc
impl StructuralEq for ArgumentLoc
impl StructuralPartialEq for ArgumentLoc
Auto Trait Implementations
impl RefUnwindSafe for ArgumentLoc
impl Send for ArgumentLoc
impl Sync for ArgumentLoc
impl Unpin for ArgumentLoc
impl UnwindSafe for ArgumentLoc
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more