Skip to content

Commit 3d89f2a

Browse files
authored
[RISCV] Remove null terminator from CSRegs in determineCalleeSaves. NFC (#74131)
Presumably this was done to make it similar to the getCalleeSavedRegs list in RegInfo, but its simpler to use a range based for loop over the array.
1 parent 2b76e20 commit 3d89f2a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Target/RISCV/RISCVFrameLowering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -981,11 +981,11 @@ void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF,
981981
RISCV::X5, RISCV::X6, RISCV::X7, /* t0-t2 */
982982
RISCV::X10, RISCV::X11, /* a0-a1, a2-a7 */
983983
RISCV::X12, RISCV::X13, RISCV::X14, RISCV::X15, RISCV::X16, RISCV::X17,
984-
RISCV::X28, RISCV::X29, RISCV::X30, RISCV::X31, 0 /* t3-t6 */
984+
RISCV::X28, RISCV::X29, RISCV::X30, RISCV::X31 /* t3-t6 */
985985
};
986986

987-
for (unsigned i = 0; CSRegs[i]; ++i)
988-
SavedRegs.set(CSRegs[i]);
987+
for (auto Reg : CSRegs)
988+
SavedRegs.set(Reg);
989989

990990
if (MF.getSubtarget<RISCVSubtarget>().hasStdExtF()) {
991991

0 commit comments

Comments
 (0)