Merge pull request #2449 from bytecodealliance/cfallin/add-pre-host-hooks
Add FuncEnvironment hooks to generate prologue and epilogue code.
This commit is contained in:
@@ -628,6 +628,26 @@ pub trait FuncEnvironment: TargetEnvironment {
|
||||
) -> WasmResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Optional callback for the `FunctionEnvironment` performing this translation to perform work
|
||||
/// before the function body is translated.
|
||||
fn before_translate_function(
|
||||
&mut self,
|
||||
_builder: &mut FunctionBuilder,
|
||||
_state: &FuncTranslationState,
|
||||
) -> WasmResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Optional callback for the `FunctionEnvironment` performing this translation to perform work
|
||||
/// after the function body is translated.
|
||||
fn after_translate_function(
|
||||
&mut self,
|
||||
_builder: &mut FunctionBuilder,
|
||||
_state: &FuncTranslationState,
|
||||
) -> WasmResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
/// An object satisfying the `ModuleEnvironment` trait can be passed as argument to the
|
||||
|
||||
Reference in New Issue
Block a user