mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-11 07:08:21 +00:00
Improved Compiler API
This commit is contained in:
@@ -207,11 +207,6 @@ impl CompilerConfig for Cranelift {
|
|||||||
fn push_middleware(&mut self, middleware: Arc<dyn FunctionMiddlewareGenerator>) {
|
fn push_middleware(&mut self, middleware: Arc<dyn FunctionMiddlewareGenerator>) {
|
||||||
self.middlewares.push(middleware);
|
self.middlewares.push(middleware);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the default features for this compiler in the given target
|
|
||||||
fn default_features_for_target(&self, _target: &Target) -> Features {
|
|
||||||
Features::default()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for Cranelift {
|
impl Default for Cranelift {
|
||||||
|
|||||||
@@ -190,11 +190,6 @@ impl CompilerConfig for LLVM {
|
|||||||
Box::new(LLVMCompiler::new(&self))
|
Box::new(LLVMCompiler::new(&self))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the default features for this compiler in the given target
|
|
||||||
fn default_features_for_target(&self, _target: &Target) -> Features {
|
|
||||||
Features::default()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Pushes a middleware onto the back of the middleware chain.
|
/// Pushes a middleware onto the back of the middleware chain.
|
||||||
fn push_middleware(&mut self, middleware: Arc<dyn FunctionMiddlewareGenerator>) {
|
fn push_middleware(&mut self, middleware: Arc<dyn FunctionMiddlewareGenerator>) {
|
||||||
self.middlewares.push(middleware);
|
self.middlewares.push(middleware);
|
||||||
|
|||||||
@@ -21,13 +21,18 @@ pub trait CompilerConfig {
|
|||||||
/// This is required for shared object generation (Native Engine),
|
/// This is required for shared object generation (Native Engine),
|
||||||
/// but will make the JIT Engine to fail, since PIC is not yet
|
/// but will make the JIT Engine to fail, since PIC is not yet
|
||||||
/// supported in the JIT linking phase.
|
/// supported in the JIT linking phase.
|
||||||
fn enable_pic(&mut self);
|
fn enable_pic(&mut self) {
|
||||||
|
// By default we do nothing, each backend will need to customize this
|
||||||
|
// in case they do something special for emitting PIC code.
|
||||||
|
}
|
||||||
|
|
||||||
/// Gets the custom compiler config
|
/// Gets the custom compiler config
|
||||||
fn compiler(&self) -> Box<dyn Compiler + Send>;
|
fn compiler(&self) -> Box<dyn Compiler + Send>;
|
||||||
|
|
||||||
/// Gets the default features for this compiler in the given target
|
/// Gets the default features for this compiler in the given target
|
||||||
fn default_features_for_target(&self, target: &Target) -> Features;
|
fn default_features_for_target(&self, target: &Target) -> Features {
|
||||||
|
Features::default()
|
||||||
|
}
|
||||||
|
|
||||||
/// Pushes a middleware onto the back of the middleware chain.
|
/// Pushes a middleware onto the back of the middleware chain.
|
||||||
fn push_middleware(&mut self, middleware: Arc<dyn FunctionMiddlewareGenerator>);
|
fn push_middleware(&mut self, middleware: Arc<dyn FunctionMiddlewareGenerator>);
|
||||||
|
|||||||
Reference in New Issue
Block a user