Use is_wasm_parameter in translating wasm calls (#1352)
* Use `is_wasm_parameter` in translating wasm calls Added in #1329 it's now possible for multiple parameters to be non-wasm parameters, so the previous `param_types` method is no longer suitable for acquiring all wasm-related parameters, rather then `FuncEnvironment` must be consulted. This removes usage of `param_types()` as a method from the wasm translation and instead adds a custom method inline for filtering the parameters based on `is_wasm_parameter`. * Apply feedback * Run rustfmt * Don't require `mut` * Run rustfmt
This commit is contained in:
committed by
Dan Gohman
parent
e1d513ab4b
commit
1266b68f9a
@@ -102,24 +102,6 @@ impl Signature {
|
||||
.count()
|
||||
> 1
|
||||
}
|
||||
|
||||
/// Collect the normal parameter types of the signature; see `[ArgumentPurpose::Normal]`.
|
||||
pub fn param_types(&self) -> Vec<Type> {
|
||||
self.params
|
||||
.iter()
|
||||
.filter(|ap| ap.purpose == ArgumentPurpose::Normal)
|
||||
.map(|ap| ap.value_type)
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Collect the normal return types of the signature; see `[ArgumentPurpose::Normal]`.
|
||||
pub fn return_types(&self) -> Vec<Type> {
|
||||
self.returns
|
||||
.iter()
|
||||
.filter(|ap| ap.purpose == ArgumentPurpose::Normal)
|
||||
.map(|ap| ap.value_type)
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper type capable of displaying a `Signature` with correct register names.
|
||||
|
||||
Reference in New Issue
Block a user