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:
@@ -221,13 +221,16 @@ impl ABIMachineSpec for S390xMachineDeps {
|
||||
8
|
||||
}
|
||||
|
||||
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 mut next_gpr = 0;
|
||||
let mut next_fpr = 0;
|
||||
let mut next_vr = 0;
|
||||
@@ -245,7 +248,7 @@ impl ABIMachineSpec for S390xMachineDeps {
|
||||
next_gpr += 1;
|
||||
}
|
||||
|
||||
for (i, mut param) in params.iter().copied().enumerate() {
|
||||
for (i, mut param) in params.into_iter().copied().enumerate() {
|
||||
let intreg = in_int_reg(param.value_type);
|
||||
let fltreg = in_flt_reg(param.value_type);
|
||||
let vecreg = in_vec_reg(param.value_type);
|
||||
|
||||
Reference in New Issue
Block a user