Cranelift: pass iterators to ABIMachineSpec::compute_arg_locs (#5095)

Instead of slices. This gives us more flexibility to pass custom sequences
without needing to allocate a `Vec` to hold them and pass in as a slice.
This commit is contained in:
Nick Fitzgerald
2022-10-21 16:08:09 -07:00
committed by GitHub
parent 5c5fa192f7
commit 442f9fa01b
5 changed files with 30 additions and 16 deletions

View File

@@ -87,13 +87,16 @@ impl ABIMachineSpec for AArch64MachineDeps {
16
}
fn compute_arg_locs(
fn compute_arg_locs<'a, I>(
call_conv: isa::CallConv,
_flags: &settings::Flags,
params: &[ir::AbiParam],
params: I,
args_or_rets: ArgsOrRets,
add_ret_area_ptr: bool,
) -> CodegenResult<(ABIArgVec, i64, Option<usize>)> {
) -> CodegenResult<(ABIArgVec, i64, Option<usize>)>
where
I: IntoIterator<Item = &'a ir::AbiParam>,
{
let is_apple_cc = call_conv.extends_apple_aarch64();
// See AArch64 ABI (https://github.com/ARM-software/abi-aa/blob/2021Q1/aapcs64/aapcs64.rst#64parameter-passing), sections 6.4.