Struct cranelift_faerie::FaerieBackend
source · pub struct FaerieBackend { /* private fields */ }
Expand description
A FaerieBackend
implements Backend
and emits “.o” files using the faerie
library.
See the FaerieBuilder
for a convenient way to construct FaerieBackend
instances.
Trait Implementations§
source§impl Backend for FaerieBackend
impl Backend for FaerieBackend
§type Product = FaerieProduct
type Product = FaerieProduct
The returned value here provides functions for emitting object files to memory and files.
source§fn new(builder: FaerieBuilder) -> Self
fn new(builder: FaerieBuilder) -> Self
Create a new FaerieBackend
using the given Cranelift target.
§type Builder = FaerieBuilder
type Builder = FaerieBuilder
A builder for constructing
Backend
instances.§type CompiledFunction = FaerieCompiledFunction
type CompiledFunction = FaerieCompiledFunction
The results of compiling a function.
§type CompiledData = FaerieCompiledData
type CompiledData = FaerieCompiledData
The results of “compiling” a data object.
§type FinalizedFunction = ()
type FinalizedFunction = ()
The completed output artifact for a function, if this is meaningful for
the
Backend
. Read more§type FinalizedData = ()
type FinalizedData = ()
The completed output artifact for a data object, if this is meaningful for
the
Backend
. Read moresource§fn declare_function(&mut self, name: &str, linkage: Linkage)
fn declare_function(&mut self, name: &str, linkage: Linkage)
Declare a function.
source§fn declare_data(&mut self, name: &str, linkage: Linkage, writable: bool)
fn declare_data(&mut self, name: &str, linkage: Linkage, writable: bool)
Declare a data object.
source§fn define_function(
&mut self,
name: &str,
ctx: &Context,
namespace: &ModuleNamespace<'_, Self>,
code_size: u32
) -> ModuleResult<FaerieCompiledFunction>
fn define_function(
&mut self,
name: &str,
ctx: &Context,
namespace: &ModuleNamespace<'_, Self>,
code_size: u32
) -> ModuleResult<FaerieCompiledFunction>
Define a function, producing the function body from the given
Context
. Read moresource§fn define_data(
&mut self,
name: &str,
_writable: bool,
data_ctx: &DataContext,
namespace: &ModuleNamespace<'_, Self>
) -> ModuleResult<FaerieCompiledData>
fn define_data(
&mut self,
name: &str,
_writable: bool,
data_ctx: &DataContext,
namespace: &ModuleNamespace<'_, Self>
) -> ModuleResult<FaerieCompiledData>
Define a zero-initialized data object of the given size. Read more
source§fn write_data_funcaddr(
&mut self,
_data: &mut FaerieCompiledData,
_offset: usize,
_what: FuncRef
)
fn write_data_funcaddr(
&mut self,
_data: &mut FaerieCompiledData,
_offset: usize,
_what: FuncRef
)
Write the address of
what
into the data for data
at offset
. data
must refer to a
defined data object. Read moresource§fn write_data_dataaddr(
&mut self,
_data: &mut FaerieCompiledData,
_offset: usize,
_what: GlobalValue,
_usize: Addend
)
fn write_data_dataaddr(
&mut self,
_data: &mut FaerieCompiledData,
_offset: usize,
_what: GlobalValue,
_usize: Addend
)
Write the address of
what
plus addend
into the data for data
at offset
. data
must
refer to a defined data object. Read moresource§fn finalize_function(
&mut self,
_func: &FaerieCompiledFunction,
_namespace: &ModuleNamespace<'_, Self>
)
fn finalize_function(
&mut self,
_func: &FaerieCompiledFunction,
_namespace: &ModuleNamespace<'_, Self>
)
Perform all outstanding relocations on the given function. This requires all
Local
and Export
entities referenced to be defined. Read moresource§fn get_finalized_function(&self, _func: &FaerieCompiledFunction)
fn get_finalized_function(&self, _func: &FaerieCompiledFunction)
Return the finalized artifact from the backend, if relevant.
source§fn finalize_data(
&mut self,
_data: &FaerieCompiledData,
_namespace: &ModuleNamespace<'_, Self>
)
fn finalize_data(
&mut self,
_data: &FaerieCompiledData,
_namespace: &ModuleNamespace<'_, Self>
)
Perform all outstanding relocations on the given data object. This requires all
Local
and Export
entities referenced to be defined. Read moresource§fn get_finalized_data(&self, _data: &FaerieCompiledData)
fn get_finalized_data(&self, _data: &FaerieCompiledData)
Return the finalized artifact from the backend, if relevant.
source§fn publish(&mut self)
fn publish(&mut self)
“Publish” all finalized functions and data objects to their ultimate destinations.
source§fn finish(self) -> FaerieProduct
fn finish(self) -> FaerieProduct
Consume this
Backend
and return a result. Some implementations may
provide additional functionality through this result. Read more