Browse Source

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.
pull/5095/head
Nick Fitzgerald 2 years ago
committed by GitHub
parent
commit
5c5fa192f7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cranelift/codegen/src/isa/s390x/abi.rs

4
cranelift/codegen/src/isa/s390x/abi.rs

@ -245,9 +245,7 @@ impl ABIMachineSpec for S390xMachineDeps {
next_gpr += 1;
}
for i in 0..params.len() {
let mut param = params[i];
for (i, mut param) in params.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);

Loading…
Cancel
Save