mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-24 17:29:26 +00:00
Update module info in-place.
This commit is contained in:
@ -8,15 +8,16 @@ use inkwell::module::{Linkage, Module};
|
||||
use inkwell::targets::FileType;
|
||||
use inkwell::DLLStorageClass;
|
||||
use rayon::prelude::{IntoParallelRefIterator, ParallelIterator};
|
||||
use std::sync::Arc;
|
||||
use wasmer_compiler::{
|
||||
Compilation, CompileError, CompileModuleInfo, Compiler, CustomSection, CustomSectionProtection,
|
||||
Dwarf, FunctionBodyData, ModuleTranslationState, RelocationTarget, SectionBody, SectionIndex,
|
||||
Symbol, SymbolRegistry, Target,
|
||||
Dwarf, FunctionBodyData, ModuleMiddlewareChain, ModuleTranslationState, RelocationTarget,
|
||||
SectionBody, SectionIndex, Symbol, SymbolRegistry, Target,
|
||||
};
|
||||
use wasmer_types::entity::{EntityRef, PrimaryMap};
|
||||
use wasmer_types::{FunctionIndex, LocalFunctionIndex, SignatureIndex};
|
||||
|
||||
//use std::sync::{Arc, Mutex};
|
||||
//use std::sync::Mutex;
|
||||
|
||||
/// A compiler that compiles a WebAssembly module with LLVM, translating the Wasm to LLVM IR,
|
||||
/// optimizing it and then translating to assembly.
|
||||
@ -233,13 +234,17 @@ impl Compiler for LLVMCompiler {
|
||||
fn compile_module<'data, 'module>(
|
||||
&self,
|
||||
target: &Target,
|
||||
compile_info: &'module CompileModuleInfo,
|
||||
compile_info: &'module mut CompileModuleInfo,
|
||||
module_translation: &ModuleTranslationState,
|
||||
function_body_inputs: PrimaryMap<LocalFunctionIndex, FunctionBodyData<'data>>,
|
||||
) -> Result<Compilation, CompileError> {
|
||||
//let data = Arc::new(Mutex::new(0));
|
||||
let memory_styles = &compile_info.memory_styles;
|
||||
let table_styles = &compile_info.table_styles;
|
||||
|
||||
let mut module = (*compile_info.module).clone();
|
||||
self.config.middlewares.apply_on_module_info(&mut module);
|
||||
compile_info.module = Arc::new(module);
|
||||
let module = &compile_info.module;
|
||||
|
||||
// TODO: merge constants in sections.
|
||||
@ -260,7 +265,7 @@ impl Compiler for LLVMCompiler {
|
||||
// TODO: remove (to serialize)
|
||||
//let _data = data.lock().unwrap();
|
||||
func_translator.translate(
|
||||
&module,
|
||||
module,
|
||||
module_translation,
|
||||
i,
|
||||
input,
|
||||
|
Reference in New Issue
Block a user