Struct cretonne_faerie::FaerieBackend
[−]
[src]
pub struct FaerieBackend { /* fields omitted */ }
A FaerieBackend
implements Backend
and emits ".o" files using the faerie
library.
Methods
impl FaerieBackend
[src]
pub fn new(
isa: Box<TargetIsa>,
name: String,
format: Format
) -> Result<Self, Error>
[src]
isa: Box<TargetIsa>,
name: String,
format: Format
) -> Result<Self, Error>
Create a new FaerieBackend
using the given Cretonne target.
pub fn name(&self) -> &str
[src]
Return the name of the output file. This is the name passed into new
.
pub fn emit(&self) -> Result<Vec<u8>, Error>
[src]
Call emit
on the faerie Artifact
, producing bytes in memory.
pub fn write(&self, sink: File) -> Result<(), Error>
[src]
Call write
on the faerie Artifact
, writing to a file.
Trait Implementations
impl Backend for FaerieBackend
[src]
type CompiledFunction = FaerieCompiledFunction
The results of compiling a function.
type CompiledData = FaerieCompiledData
The results of "compiling" a data object.
type FinalizedFunction = ()
The completed output artifact for a function, if this is meaningful for the Backend. Read more
type FinalizedData = ()
The completed output artifact for a data object, if this is meaningful for the Backend. Read more
fn isa(&self) -> &TargetIsa
[src]
Return the TargetIsa
to compile for.
fn declare_function(&mut self, name: &str, linkage: Linkage)
[src]
Declare a function.
fn declare_data(&mut self, name: &str, linkage: Linkage, writable: bool)
[src]
Declare a data object.
fn define_function(
&mut self,
name: &str,
ctx: &Context,
namespace: &ModuleNamespace<Self>,
code_size: u32
) -> Result<FaerieCompiledFunction, CtonError>
[src]
&mut self,
name: &str,
ctx: &Context,
namespace: &ModuleNamespace<Self>,
code_size: u32
) -> Result<FaerieCompiledFunction, CtonError>
Define a function, producing the function body from the given Context
. Read more
fn define_data(
&mut self,
name: &str,
data_ctx: &DataContext,
namespace: &ModuleNamespace<Self>
) -> Result<FaerieCompiledData, CtonError>
[src]
&mut self,
name: &str,
data_ctx: &DataContext,
namespace: &ModuleNamespace<Self>
) -> Result<FaerieCompiledData, CtonError>
Define a zero-initialized data object of the given size. Read more
fn write_data_funcaddr(
&mut self,
_data: &mut FaerieCompiledData,
_offset: usize,
_what: FuncRef
)
[src]
&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 more
fn write_data_dataaddr(
&mut self,
_data: &mut FaerieCompiledData,
_offset: usize,
_what: GlobalVar,
_usize: Addend
)
[src]
&mut self,
_data: &mut FaerieCompiledData,
_offset: usize,
_what: GlobalVar,
_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 more
fn finalize_function(
&mut self,
_func: &FaerieCompiledFunction,
_namespace: &ModuleNamespace<Self>
)
[src]
&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 more
fn finalize_data(
&mut self,
_data: &FaerieCompiledData,
_namespace: &ModuleNamespace<Self>
)
[src]
&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 more