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

@@ -7,6 +7,7 @@ use inkwell::OptimizationLevel;
use itertools::Itertools;
use std::sync::Arc;
use target_lexicon::Architecture;
use wasm_common::Features;
use wasm_common::{FunctionType, LocalFunctionIndex};
use wasmer_compiler::{Compiler, CompilerConfig, FunctionMiddlewareGenerator, Target, Triple};
@@ -189,6 +190,11 @@ impl CompilerConfig for LLVM {
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.
fn push_middleware(&mut self, middleware: Arc<dyn FunctionMiddlewareGenerator>) {
self.middlewares.push(middleware);