Add a is_wasm_parameter method to the wasm FuncEnvironment. (#1329)
This provides a more flexible way to allow embedding to tell cranelift-wasm which function parameters are hidden, and which should be translated as wasm user variables. This replaces https://github.com/bytecodealliance/cranelift/pull/1086.
This commit is contained in:
@@ -201,6 +201,10 @@ impl<'dummy_environment> TargetEnvironment for DummyFuncEnvironment<'dummy_envir
|
||||
}
|
||||
|
||||
impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environment> {
|
||||
fn is_wasm_parameter(&self, func: &ir::Function, index: usize) -> bool {
|
||||
func.signature.params[index].purpose == ir::ArgumentPurpose::Normal
|
||||
}
|
||||
|
||||
fn return_mode(&self) -> ReturnMode {
|
||||
self.return_mode
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user