Correctly count the number of wasm parameters. (#1337)

* Correctly count the number of wasm parameters.

Following up on #1329, this further replaces `num_normal_params` with a function
which calls `is_wasm_parameter` to correctly count the number of wasm
parameters a function has.

* Move is_wasm_parameter's implementation into the trait.
This commit is contained in:
Dan Gohman
2020-01-14 11:42:22 -08:00
committed by GitHub
parent dd497c19e1
commit 1d504ecf6d
5 changed files with 18 additions and 18 deletions

View File

@@ -201,10 +201,6 @@ 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
}