pass compiler_config along to other backends

This commit is contained in:
Mark McCaskey
2019-03-27 14:18:34 -07:00
parent 315d8286c4
commit 51c2111d53
4 changed files with 26 additions and 8 deletions

View File

@ -1,5 +1,5 @@
use wasmer_runtime_core::{
backend::Backend,
backend::{Backend, CompilerConfig},
module::{
DataInitializer, ExportIndex, ImportName, ModuleInfo, StringTable, StringTableBuilder,
TableInitializer,
@ -18,7 +18,10 @@ use wasmparser::{
SectionCode, Type as WpType,
};
pub fn read_module(wasm: &[u8]) -> Result<(ModuleInfo, CodeSectionReader), BinaryReaderError> {
pub fn read_module(
wasm: &[u8],
compiler_config: &CompilerConfig,
) -> Result<(ModuleInfo, CodeSectionReader), BinaryReaderError> {
let mut info = ModuleInfo {
memories: Map::new(),
globals: Map::new(),
@ -42,6 +45,8 @@ pub fn read_module(wasm: &[u8]) -> Result<(ModuleInfo, CodeSectionReader), Binar
namespace_table: StringTable::new(),
name_table: StringTable::new(),
em_symbol_map: compiler_config.symbol_map.clone(),
};
let mut reader = ModuleReader::new(wasm)?;