Added custom sections

Based on this document:

https://www.notion.so/wasmer/Compiler-Refactor-Proposal-c678a73b0e2c4572834d2dba21263916
This commit is contained in:
Syrus
2020-05-01 11:23:22 -07:00
parent b5d9b448ae
commit c33a368ff8
8 changed files with 75 additions and 44 deletions

View File

@ -62,6 +62,8 @@ impl Compiler for LLVMCompiler {
) -> Result<Compilation, CompileError> {
//let data = Arc::new(Mutex::new(0));
let mut func_names = SecondaryMap::new();
let custom_sections = PrimaryMap::new();
for (func_index, _) in &module.functions {
func_names[func_index] = module
.func_names
@ -90,7 +92,7 @@ impl Compiler for LLVMCompiler {
.into_iter()
.collect::<PrimaryMap<LocalFuncIndex, _>>();
Ok(Compilation::new(functions))
Ok(Compilation::new(functions, custom_sections))
}
fn compile_wasm_trampolines(