pub struct LLVM {
pub(crate) enable_nan_canonicalization: bool,
pub(crate) enable_non_volatile_memops: bool,
pub(crate) enable_readonly_funcref_table: bool,
pub(crate) enable_verifier: bool,
pub(crate) enable_perfmap: bool,
pub(crate) opt_level: LLVMOptLevel,
is_pic: bool,
pub(crate) callbacks: Option<LLVMCallbacks>,
pub(crate) middlewares: Vec<Arc<dyn ModuleMiddleware>>,
pub(crate) num_threads: NonZero<usize>,
pub(crate) verbose_asm: bool,
}Fields§
§enable_nan_canonicalization: bool§enable_non_volatile_memops: bool§enable_readonly_funcref_table: bool§enable_verifier: bool§enable_perfmap: bool§opt_level: LLVMOptLevel§is_pic: bool§callbacks: Option<LLVMCallbacks>§middlewares: Vec<Arc<dyn ModuleMiddleware>>The middleware chain.
num_threads: NonZero<usize>Number of threads to use when compiling a module.
verbose_asm: boolImplementations§
Source§impl LLVM
impl LLVM
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new configuration object with the default configuration specified.
Sourcepub fn opt_level(&mut self, opt_level: LLVMOptLevel) -> &mut Self
pub fn opt_level(&mut self, opt_level: LLVMOptLevel) -> &mut Self
The optimization levels when optimizing the IR.
pub fn num_threads(&mut self, num_threads: NonZero<usize>) -> &mut Self
pub fn verbose_asm(&mut self, verbose_asm: bool) -> &mut Self
Sourcepub fn callbacks(&mut self, callbacks: Option<LLVMCallbacks>) -> &mut Self
pub fn callbacks(&mut self, callbacks: Option<LLVMCallbacks>) -> &mut Self
Callbacks that will triggered in the different compilation phases in LLVM.
Sourcepub fn non_volatile_memops(
&mut self,
enable_non_volatile_memops: bool,
) -> &mut Self
pub fn non_volatile_memops( &mut self, enable_non_volatile_memops: bool, ) -> &mut Self
For the LLVM compiler, we can use non-volatile memory operations which lead to a better performance (but are not 100% SPEC compliant).
Sourcepub fn readonly_funcref_table(
&mut self,
enable_readonly_funcref_table: bool,
) -> &mut Self
pub fn readonly_funcref_table( &mut self, enable_readonly_funcref_table: bool, ) -> &mut Self
Enables treating eligible funcref tables as read-only so the backend can place them in read-only data.
fn reloc_mode(&self, binary_format: BinaryFormat) -> RelocMode
fn code_model(&self, binary_format: BinaryFormat) -> CodeModel
pub(crate) fn target_operating_system(&self, target: &Target) -> OperatingSystem
pub(crate) fn target_binary_format(&self, target: &Target) -> BinaryFormat
fn target_triple(&self, target: &Target) -> TargetTriple
Sourcepub fn target_machine(&self, target: &Target) -> TargetMachine
pub fn target_machine(&self, target: &Target) -> TargetMachine
Generates the target machine for the current target
pub(crate) fn target_machine_with_opt( &self, target: &Target, opt_style: OptimizationStyle, ) -> TargetMachine
Trait Implementations§
Source§impl CompilerConfig for LLVM
impl CompilerConfig for LLVM
Source§fn enable_pic(&mut self)
fn enable_pic(&mut self)
Emit code suitable for dlopen.
Source§fn enable_verifier(&mut self)
fn enable_verifier(&mut self)
Whether to verify compiler IR.
Source§fn enable_non_volatile_memops(&mut self)
fn enable_non_volatile_memops(&mut self)
For the LLVM compiler, we can use non-volatile memory operations which lead to a better performance (but are not 100% SPEC compliant).
Source§fn enable_readonly_funcref_table(&mut self)
fn enable_readonly_funcref_table(&mut self)
Enables treating eligible funcref tables as read-only so the backend can place them in read-only data.
Source§fn push_middleware(&mut self, middleware: Arc<dyn ModuleMiddleware>)
fn push_middleware(&mut self, middleware: Arc<dyn ModuleMiddleware>)
Pushes a middleware onto the back of the middleware chain.
Source§fn enable_perfmap(&mut self)
fn enable_perfmap(&mut self)
Source§fn canonicalize_nans(&mut self, enable: bool)
fn canonicalize_nans(&mut self, enable: bool)
Source§fn supported_features_for_target(&self, _target: &Target) -> Features
fn supported_features_for_target(&self, _target: &Target) -> Features
§fn default_features_for_target(&self, target: &Target) -> Features
fn default_features_for_target(&self, target: &Target) -> Features
Auto Trait Implementations§
impl Freeze for LLVM
impl !RefUnwindSafe for LLVM
impl Send for LLVM
impl Sync for LLVM
impl Unpin for LLVM
impl !UnwindSafe for LLVM
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more