[llvm-commits] [llvm] r143991 - /llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp
Akira Hatanaka
ahatanaka at mips.com
Mon Nov 7 11:03:41 PST 2011
Author: ahatanak
Date: Mon Nov 7 13:03:40 2011
New Revision: 143991
URL: http://llvm.org/viewvc/llvm-project?rev=143991&view=rev
Log:
Use array_lengthof to compute the number of iterations of a loop.
Modified:
llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp?rev=143991&r1=143990&r2=143991&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp Mon Nov 7 13:03:40 2011
@@ -191,23 +191,23 @@
getReservedRegs(const MachineFunction &MF) const {
static const unsigned ReservedCPURegs[] = {
Mips::ZERO, Mips::AT, Mips::K0, Mips::K1,
- Mips::GP, Mips::SP, Mips::FP, Mips::RA, 0
+ Mips::GP, Mips::SP, Mips::FP, Mips::RA
};
static const unsigned ReservedCPU64Regs[] = {
Mips::ZERO_64, Mips::AT_64, Mips::K0_64, Mips::K1_64,
- Mips::GP_64, Mips::SP_64, Mips::FP_64, Mips::RA_64, 0
+ Mips::GP_64, Mips::SP_64, Mips::FP_64, Mips::RA_64
};
BitVector Reserved(getNumRegs());
typedef TargetRegisterClass::iterator RegIter;
- for (const unsigned *Reg = ReservedCPURegs; *Reg; ++Reg)
- Reserved.set(*Reg);
+ for (unsigned I = 0; I < array_lengthof(ReservedCPURegs); ++I)
+ Reserved.set(ReservedCPURegs[I]);
if (Subtarget.hasMips64()) {
- for (const unsigned *Reg = ReservedCPU64Regs; *Reg; ++Reg)
- Reserved.set(*Reg);
+ for (unsigned I = 0; I < array_lengthof(ReservedCPU64Regs); ++I)
+ Reserved.set(ReservedCPU64Regs[I]);
// Reserve all registers in AFGR64.
for (RegIter Reg = Mips::AFGR64RegisterClass->begin();
More information about the llvm-commits
mailing list