mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-25 09:49:27 +00:00
Add support for middleware to experimental_native_compile_module and make it work on compiler-llvm.
This commit is contained in:
@ -211,7 +211,7 @@ impl Compiler for LLVMCompiler {
|
|||||||
fn experimental_native_compile_module<'data, 'module>(
|
fn experimental_native_compile_module<'data, 'module>(
|
||||||
&self,
|
&self,
|
||||||
target: &Target,
|
target: &Target,
|
||||||
module: &'module CompileModuleInfo,
|
compile_info: &'module mut CompileModuleInfo,
|
||||||
module_translation: &ModuleTranslationState,
|
module_translation: &ModuleTranslationState,
|
||||||
// The list of function bodies
|
// The list of function bodies
|
||||||
function_body_inputs: &PrimaryMap<LocalFunctionIndex, FunctionBodyData<'data>>,
|
function_body_inputs: &PrimaryMap<LocalFunctionIndex, FunctionBodyData<'data>>,
|
||||||
@ -219,9 +219,13 @@ impl Compiler for LLVMCompiler {
|
|||||||
// The metadata to inject into the wasmer_metadata section of the object file.
|
// The metadata to inject into the wasmer_metadata section of the object file.
|
||||||
wasmer_metadata: &[u8],
|
wasmer_metadata: &[u8],
|
||||||
) -> Option<Result<Vec<u8>, CompileError>> {
|
) -> Option<Result<Vec<u8>, CompileError>> {
|
||||||
|
let mut module = (*compile_info.module).clone();
|
||||||
|
self.config.middlewares.apply_on_module_info(&mut module);
|
||||||
|
compile_info.module = Arc::new(module);
|
||||||
|
|
||||||
Some(self.compile_native_object(
|
Some(self.compile_native_object(
|
||||||
target,
|
target,
|
||||||
module,
|
compile_info,
|
||||||
module_translation,
|
module_translation,
|
||||||
function_body_inputs,
|
function_body_inputs,
|
||||||
symbol_registry,
|
symbol_registry,
|
||||||
|
@ -96,7 +96,7 @@ pub trait Compiler {
|
|||||||
fn experimental_native_compile_module<'data, 'module>(
|
fn experimental_native_compile_module<'data, 'module>(
|
||||||
&self,
|
&self,
|
||||||
_target: &Target,
|
_target: &Target,
|
||||||
_module: &'module CompileModuleInfo,
|
_module: &'module mut CompileModuleInfo,
|
||||||
_module_translation: &ModuleTranslationState,
|
_module_translation: &ModuleTranslationState,
|
||||||
// The list of function bodies
|
// The list of function bodies
|
||||||
_function_body_inputs: &PrimaryMap<LocalFunctionIndex, FunctionBodyData<'data>>,
|
_function_body_inputs: &PrimaryMap<LocalFunctionIndex, FunctionBodyData<'data>>,
|
||||||
|
Reference in New Issue
Block a user