Struct cranelift_codegen::ir::Signature
source · pub struct Signature {
pub params: Vec<AbiParam>,
pub returns: Vec<AbiParam>,
pub call_conv: CallConv,
}
Expand description
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.
Implementations§
source§impl Signature
impl Signature
sourcepub fn clear(&mut self, call_conv: CallConv)
pub fn clear(&mut self, call_conv: CallConv)
Clear the signature so it is identical to a fresh one returned by new()
.
sourcepub fn special_param_index(&self, purpose: ArgumentPurpose) -> Option<usize>
pub fn special_param_index(&self, purpose: ArgumentPurpose) -> Option<usize>
Find the index of a presumed unique special-purpose parameter.
sourcepub fn special_return_index(&self, purpose: ArgumentPurpose) -> Option<usize>
pub fn special_return_index(&self, purpose: ArgumentPurpose) -> Option<usize>
Find the index of a presumed unique special-purpose parameter.
sourcepub fn uses_special_param(&self, purpose: ArgumentPurpose) -> bool
pub fn uses_special_param(&self, purpose: ArgumentPurpose) -> bool
Does this signature have a parameter whose ArgumentPurpose
is
purpose
?
sourcepub fn uses_special_return(&self, purpose: ArgumentPurpose) -> bool
pub fn uses_special_return(&self, purpose: ArgumentPurpose) -> bool
Does this signature have a return whose ArgumentPurpose
is purpose
?
sourcepub fn num_special_params(&self) -> usize
pub fn num_special_params(&self) -> usize
How many special parameters does this function have?
sourcepub fn num_special_returns(&self) -> usize
pub fn num_special_returns(&self) -> usize
How many special returns does this function have?
sourcepub fn uses_struct_return_param(&self) -> bool
pub fn uses_struct_return_param(&self) -> bool
Does this signature take an struct return pointer parameter?
sourcepub fn is_multi_return(&self) -> bool
pub fn is_multi_return(&self) -> bool
Does this return more than one normal value? (Pre-struct return legalization)
Trait Implementations§
source§impl PartialEq<Signature> for Signature
impl PartialEq<Signature> for Signature
impl Eq 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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.