Struct cranelift_codegen::ir::AbiParam
source · pub struct AbiParam {
pub value_type: Type,
pub purpose: ArgumentPurpose,
pub extension: ArgumentExtension,
}Expand description
Function parameter or return value descriptor.
This describes the value type being passed to or from a function along with flags that affect how the argument is passed.
Fields§
§value_type: TypeType of the argument value.
purpose: ArgumentPurposeSpecial purpose of argument, or Normal.
extension: ArgumentExtensionMethod for extending argument to a full register.
Implementations§
source§impl AbiParam
impl AbiParam
sourcepub fn new(vt: Type) -> Self
pub fn new(vt: Type) -> Self
Create a parameter with default flags.
Examples found in repository?
src/ir/libcall.rs (line 128)
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
pub fn signature(&self, call_conv: CallConv) -> Signature {
use types::*;
let mut sig = Signature::new(call_conv);
match self {
LibCall::CeilF32 | LibCall::FloorF32 | LibCall::TruncF32 | LibCall::NearestF32 => {
sig.params.push(AbiParam::new(F32));
sig.returns.push(AbiParam::new(F32));
}
LibCall::TruncF64 | LibCall::FloorF64 | LibCall::CeilF64 | LibCall::NearestF64 => {
sig.params.push(AbiParam::new(F64));
sig.returns.push(AbiParam::new(F64));
}
LibCall::FmaF32 | LibCall::FmaF64 => {
let ty = if *self == LibCall::FmaF32 { F32 } else { F64 };
sig.params.push(AbiParam::new(ty));
sig.params.push(AbiParam::new(ty));
sig.params.push(AbiParam::new(ty));
sig.returns.push(AbiParam::new(ty));
}
LibCall::Probestack
| LibCall::Memcpy
| LibCall::Memset
| LibCall::Memmove
| LibCall::Memcmp
| LibCall::ElfTlsGetAddr
| LibCall::ElfTlsGetOffset => unimplemented!(),
}
sig
}sourcepub fn special(vt: Type, purpose: ArgumentPurpose) -> Self
pub fn special(vt: Type, purpose: ArgumentPurpose) -> Self
Create a special-purpose parameter that is not (yet) bound to a specific register.
Trait Implementations§
source§impl PartialEq<AbiParam> for AbiParam
impl PartialEq<AbiParam> for AbiParam
impl Copy for AbiParam
impl Eq for AbiParam
impl StructuralEq for AbiParam
impl StructuralPartialEq for AbiParam
Auto Trait Implementations§
impl RefUnwindSafe for AbiParam
impl Send for AbiParam
impl Sync for AbiParam
impl Unpin for AbiParam
impl UnwindSafe for AbiParam
Blanket Implementations§
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
Compare self to
key and return true if they are equal.