Cranelift: use .enumerate() to avoid indexing in s390x backend (#5094)

This can help rustc/llvm avoid bounds checks, but more importantly I will have
future changes here that remove indexing of params, and instead hand them out as
an iterator.
This commit is contained in:
Nick Fitzgerald
2022-10-21 13:08:56 -07:00
committed by GitHub
parent 4a66c3b855
commit 5c5fa192f7

View File

@@ -245,9 +245,7 @@ impl ABIMachineSpec for S390xMachineDeps {
next_gpr += 1; next_gpr += 1;
} }
for i in 0..params.len() { for (i, mut param) in params.iter().copied().enumerate() {
let mut param = params[i];
let intreg = in_int_reg(param.value_type); let intreg = in_int_reg(param.value_type);
let fltreg = in_flt_reg(param.value_type); let fltreg = in_flt_reg(param.value_type);
let vecreg = in_vec_reg(param.value_type); let vecreg = in_vec_reg(param.value_type);