diff options
author | Craig Topper <craig.topper@sifive.com> | 2023-12-01 14:05:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-01 14:05:55 -0800 |
commit | 3d89f2ac16c2a05450693dd0ca223891f5014c1b (patch) | |
tree | f1322cff70a4b86ef19c1cb154ff927083d9946a | |
parent | 2b76e20ea782790a78ec58d5f94ce88a173bab7f (diff) |
[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.
-rw-r--r-- | llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp index 1709ac28d3c5..8dfea6d38620 100644 --- a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp @@ -981,11 +981,11 @@ void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF, RISCV::X5, RISCV::X6, RISCV::X7, /* t0-t2 */ RISCV::X10, RISCV::X11, /* a0-a1, a2-a7 */ RISCV::X12, RISCV::X13, RISCV::X14, RISCV::X15, RISCV::X16, RISCV::X17, - RISCV::X28, RISCV::X29, RISCV::X30, RISCV::X31, 0 /* t3-t6 */ + RISCV::X28, RISCV::X29, RISCV::X30, RISCV::X31 /* t3-t6 */ }; - for (unsigned i = 0; CSRegs[i]; ++i) - SavedRegs.set(CSRegs[i]); + for (auto Reg : CSRegs) + SavedRegs.set(Reg); if (MF.getSubtarget<RISCVSubtarget>().hasStdExtF()) { |