Struct cranelift_codegen::ir::Signature [−][src]
pub struct Signature {
pub params: Vec<AbiParam>,
pub returns: Vec<AbiParam>,
pub call_conv: CallConv,
pub argument_bytes: Option<u32>,
}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.
argument_bytes: Option<u32>
When the signature has been legalized to a specific ISA, this holds the size of the
argument array on the stack. Before legalization, this is None.
This can be computed from the legalized params array as the maximum (offset plus
byte size) of the ArgumentLoc::Stack(offset) argument.
Methods
impl Signature[src]
impl Signaturepub fn new(call_conv: CallConv) -> Self[src]
pub fn new(call_conv: CallConv) -> SelfCreate a new blank signature.
pub fn clear(&mut self, call_conv: CallConv)[src]
pub fn clear(&mut self, call_conv: CallConv)Clear the signature so it is identical to a fresh one returned by new().
pub fn compute_argument_bytes(&mut self)[src]
pub fn compute_argument_bytes(&mut self)Compute the size of the stack arguments and mark signature as legalized.
Even if there are no stack arguments, this will set params to Some(0) instead
of None. This indicates that the signature has been legalized.
pub fn display<'a, R: Into<Option<&'a RegInfo>>>(
&'a self,
regs: R
) -> DisplaySignature<'a>[src]
pub fn display<'a, R: Into<Option<&'a RegInfo>>>(
&'a self,
regs: R
) -> DisplaySignature<'a>Return an object that can display self with correct register names.
pub fn special_param_index(&self, purpose: ArgumentPurpose) -> Option<usize>[src]
pub fn special_param_index(&self, purpose: ArgumentPurpose) -> Option<usize>Find the index of a presumed unique special-purpose parameter.
Trait Implementations
impl Clone for Signature[src]
impl Clone for Signaturefn clone(&self) -> Signature[src]
fn clone(&self) -> SignatureReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Signature[src]
impl Debug for Signaturefn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for Signature[src]
impl PartialEq for Signaturefn eq(&self, other: &Signature) -> bool[src]
fn eq(&self, other: &Signature) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Signature) -> bool[src]
fn ne(&self, other: &Signature) -> boolThis method tests for !=.
impl Eq for Signature[src]
impl Eq for Signatureimpl Hash for Signature[src]
impl Hash for Signaturefn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Display for Signature[src]
impl Display for Signature