Struct cranelift_object::ObjectBuilder
source · [−]pub struct ObjectBuilder { /* private fields */ }Expand description
A builder for ObjectModule.
Implementations
sourceimpl ObjectBuilder
impl ObjectBuilder
sourcepub fn new<V: Into<Vec<u8>>>(
isa: Box<dyn TargetIsa>,
name: V,
libcall_names: Box<dyn Fn(LibCall) -> String + Send + Sync>
) -> ModuleResult<Self>
pub fn new<V: Into<Vec<u8>>>(
isa: Box<dyn TargetIsa>,
name: V,
libcall_names: Box<dyn Fn(LibCall) -> String + Send + Sync>
) -> ModuleResult<Self>
Create a new ObjectBuilder using the given Cranelift target, that
can be passed to ObjectModule::new.
The libcall_names function provides a way to translate cranelift_codegen’s ir::LibCall
enum to symbols. LibCalls are inserted in the IR as part of the legalization for certain
floating point instructions, and for stack probes. If you don’t know what to use for this
argument, use cranelift_module::default_libcall_names().
sourcepub fn function_alignment(&mut self, alignment: u64) -> &mut Self
pub fn function_alignment(&mut self, alignment: u64) -> &mut Self
Set the alignment used for functions.
sourcepub fn per_function_section(&mut self, per_function_section: bool) -> &mut Self
pub fn per_function_section(&mut self, per_function_section: bool) -> &mut Self
Set if every function should end up in their own section.
Auto Trait Implementations
impl !RefUnwindSafe for ObjectBuilder
impl Send for ObjectBuilder
impl Sync for ObjectBuilder
impl Unpin for ObjectBuilder
impl !UnwindSafe for ObjectBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more