Struct cranelift_codegen::ir::ExtFuncData
source · [−]pub struct ExtFuncData {
pub name: ExternalName,
pub signature: SigRef,
pub colocated: bool,
}
Expand description
An external function.
Information about a function that can be called directly with a direct call
instruction.
Fields
name: ExternalName
Name of the external function.
signature: SigRef
Call signature of function.
colocated: bool
Will this function be defined nearby, such that it will always be a certain distance away, after linking? If so, references to it can avoid going through a GOT or PLT. Note that symbols meant to be preemptible cannot be considered colocated.
If true
, some backends may use relocation forms that have limited range. The exact
distance depends on the code model in use. Currently on AArch64, for example, Cranelift
uses a custom code model supporting up to +/- 128MB displacements. If it is unknown how
far away the target will be, it is best not to set the colocated
flag; in general, this
flag is best used when the target is known to be in the same unit of code generation, such
as a Wasm module.
See the documentation for RelocDistance
for more details. A
colocated
flag value of true
implies RelocDistance::Near
.
Implementations
sourceimpl ExtFuncData
impl ExtFuncData
sourcepub fn reloc_distance(&self) -> RelocDistance
pub fn reloc_distance(&self) -> RelocDistance
Return an estimate of the distance to the referred-to function symbol.
sourcepub fn display<'a>(
&'a self,
params: Option<&'a FunctionParameters>
) -> DisplayableExtFuncData<'a>
pub fn display<'a>(
&'a self,
params: Option<&'a FunctionParameters>
) -> DisplayableExtFuncData<'a>
Returns a displayable version of the ExtFuncData
, with or without extra context to
prettify the output.
Trait Implementations
sourceimpl Clone for ExtFuncData
impl Clone for ExtFuncData
sourcefn clone(&self) -> ExtFuncData
fn clone(&self) -> ExtFuncData
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 ExtFuncData
impl Debug for ExtFuncData
sourceimpl Hash for ExtFuncData
impl Hash for ExtFuncData
sourceimpl PartialEq<ExtFuncData> for ExtFuncData
impl PartialEq<ExtFuncData> for ExtFuncData
sourcefn eq(&self, other: &ExtFuncData) -> bool
fn eq(&self, other: &ExtFuncData) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ExtFuncData) -> bool
fn ne(&self, other: &ExtFuncData) -> bool
This method tests for !=
.
impl StructuralPartialEq for ExtFuncData
Auto Trait Implementations
impl RefUnwindSafe for ExtFuncData
impl Send for ExtFuncData
impl Sync for ExtFuncData
impl Unpin for ExtFuncData
impl UnwindSafe for ExtFuncData
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more