[mips] Use range-based for loops. NFC

llvm-svn: 361964
This commit is contained in:
Simon Atanasyan 2019-05-29 14:58:50 +00:00
parent 64345f280b
commit af7bf2f687
1 changed files with 4 additions and 8 deletions

View File

@ -159,8 +159,6 @@ getReservedRegs(const MachineFunction &MF) const {
BitVector Reserved(getNumRegs());
const MipsSubtarget &Subtarget = MF.getSubtarget<MipsSubtarget>();
using RegIter = TargetRegisterClass::const_iterator;
for (unsigned I = 0; I < array_lengthof(ReservedGPR32); ++I)
Reserved.set(ReservedGPR32[I]);
@ -182,14 +180,12 @@ getReservedRegs(const MachineFunction &MF) const {
if (Subtarget.isFP64bit()) {
// Reserve all registers in AFGR64.
for (RegIter Reg = Mips::AFGR64RegClass.begin(),
EReg = Mips::AFGR64RegClass.end(); Reg != EReg; ++Reg)
Reserved.set(*Reg);
for (MCPhysReg Reg : Mips::AFGR64RegClass)
Reserved.set(Reg);
} else {
// Reserve all registers in FGR64.
for (RegIter Reg = Mips::FGR64RegClass.begin(),
EReg = Mips::FGR64RegClass.end(); Reg != EReg; ++Reg)
Reserved.set(*Reg);
for (MCPhysReg Reg : Mips::FGR64RegClass)
Reserved.set(Reg);
}
// Reserve FP if this function should have a dedicated frame pointer register.
if (Subtarget.getFrameLowering()->hasFP(MF)) {