Improved feature-generation to be compiler-based

This commit is contained in:
Syrus
2020-06-18 02:11:54 -07:00
parent 422051ebe5
commit 769ffebb61
7 changed files with 44 additions and 26 deletions

View File

@@ -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);