[−]Struct cranelift::prelude::Signature
Function signature.
The function signature describes the types of formal parameters and return values along with other details that are needed to call a function correctly.
A signature can optionally include ISA-specific ABI information which specifies exactly how arguments and return values are passed.
Fields
params: Vec<AbiParam>
The arguments passed to the function.
returns: Vec<AbiParam>
Values returned from the function.
call_conv: CallConv
Calling convention.
Methods
impl Signature
pub fn new(call_conv: CallConv) -> Signature
Create a new blank signature.
pub fn clear(&mut self, call_conv: CallConv)
Clear the signature so it is identical to a fresh one returned by new()
.
pub fn display<'a, R>(&'a self, regs: R) -> DisplaySignature<'a> where
R: Into<Option<&'a RegInfo>>,
R: Into<Option<&'a RegInfo>>,
Return an object that can display self
with correct register names.
pub fn special_param_index(&self, purpose: ArgumentPurpose) -> Option<usize>
Find the index of a presumed unique special-purpose parameter.
pub fn special_return_index(&self, purpose: ArgumentPurpose) -> Option<usize>
Find the index of a presumed unique special-purpose parameter.
pub fn uses_special_param(&self, purpose: ArgumentPurpose) -> bool
Does this signature have a parameter whose ArgumentPurpose
is
purpose
?
pub fn uses_special_return(&self, purpose: ArgumentPurpose) -> bool
Does this signature have a return whose ArgumentPurpose
is purpose
?
pub fn num_special_params(&self) -> usize
How many special parameters does this function have?
pub fn num_special_returns(&self) -> usize
How many special returns does this function have?
pub fn num_normal_params(&self) -> usize
Count the number of normal parameters in a signature. Exclude special-purpose parameters that represent runtime stuff and not WebAssembly arguments.
pub fn uses_struct_return_param(&self) -> bool
Does this signature take an struct return pointer parameter?
pub fn is_multi_return(&self) -> bool
Does this return more than one normal value? (Pre-struct return legalization)
pub fn param_types(&self) -> Vec<Type>
Collect the normal parameter types of the signature; see [ArgumentPurpose::Normal]
.
pub fn return_types(&self) -> Vec<Type>
Collect the normal return types of the signature; see [ArgumentPurpose::Normal]
.
Trait Implementations
impl Clone for Signature
fn clone(&self) -> Signature
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Signature
impl Display for Signature
impl Eq for Signature
impl Hash for Signature
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Signature> for Signature
impl StructuralEq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,