mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-09 22:28:21 +00:00
Improved feature-generation to be compiler-based
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
use crate::compiler::SinglepassCompiler;
|
||||
use std::sync::Arc;
|
||||
use wasm_common::Features;
|
||||
use wasmer_compiler::{Compiler, CompilerConfig, CpuFeature, FunctionMiddlewareGenerator, Target};
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -57,6 +58,13 @@ impl CompilerConfig for Singlepass {
|
||||
Box::new(SinglepassCompiler::new(&self))
|
||||
}
|
||||
|
||||
/// Gets the default features for this compiler in the given target
|
||||
fn default_features_for_target(&self, target: &Target) -> Features {
|
||||
let mut features = Features::default();
|
||||
features.multi_value(false);
|
||||
features
|
||||
}
|
||||
|
||||
/// Pushes a middleware onto the back of the middleware chain.
|
||||
fn push_middleware(&mut self, middleware: Arc<dyn FunctionMiddlewareGenerator>) {
|
||||
self.middlewares.push(middleware);
|
||||
|
||||
Reference in New Issue
Block a user