Trait wasmer_compiler::compiler::CompilerConfig

source ·
pub trait CompilerConfig {
    // Required methods
    fn compiler(self: Box<Self>) -> Box<dyn Compiler>;
    fn push_middleware(&mut self, middleware: Arc<dyn ModuleMiddleware>);

    // Provided methods
    fn enable_pic(&mut self) { ... }
    fn enable_verifier(&mut self) { ... }
    fn canonicalize_nans(&mut self, _enable: bool) { ... }
    fn default_features_for_target(&self, _target: &Target) -> Features { ... }
}
Expand description

The compiler configuration options.

Required Methods§

source

fn compiler(self: Box<Self>) -> Box<dyn Compiler>

Gets the custom compiler config

source

fn push_middleware(&mut self, middleware: Arc<dyn ModuleMiddleware>)

Pushes a middleware onto the back of the middleware chain.

Provided Methods§

source

fn enable_pic(&mut self)

Enable Position Independent Code (PIC).

This is required for shared object generation (Native Engine), but will make the JIT Engine to fail, since PIC is not yet supported in the JIT linking phase.

source

fn enable_verifier(&mut self)

Enable compiler IR verification.

For compilers capable of doing so, this enables internal consistency checking.

source

fn canonicalize_nans(&mut self, _enable: bool)

Enable NaN canonicalization.

NaN canonicalization is useful when trying to run WebAssembly deterministically across different architectures.

source

fn default_features_for_target(&self, _target: &Target) -> Features

Gets the default features for this compiler in the given target

Trait Implementations§

source§

impl<T> From<T> for Box<dyn CompilerConfig + 'static>
where T: CompilerConfig + 'static,

source§

fn from(other: T) -> Self

Converts to this type from the input type.

Implementors§