diff options
| author | Dan Gohman <gohman@apple.com> | 2010-06-18 18:13:55 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-06-18 18:13:55 +0000 |
| commit | 882bb2984ebba782593fecd02befe5d5b6a40eb7 (patch) | |
| tree | af663b2cf89b4070295567512002bef4bdc9994d /llvm/lib/CodeGen/MachineRegisterInfo.cpp | |
| parent | 3ac52b3e43d02af9f72ff18fab10717f70077dd5 (diff) | |
| download | bcm5719-llvm-882bb2984ebba782593fecd02befe5d5b6a40eb7.tar.gz bcm5719-llvm-882bb2984ebba782593fecd02befe5d5b6a40eb7.zip | |
Start TargetRegisterClass indices at 0 instead of 1, so that
MachineRegisterInfo doesn't have to confusingly allocate an extra
entry.
llvm-svn: 106296
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MachineRegisterInfo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp index e09e7432d4d..3982499eab6 100644 --- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp +++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp @@ -20,7 +20,7 @@ using namespace llvm; MachineRegisterInfo::MachineRegisterInfo(const TargetRegisterInfo &TRI) { VRegInfo.reserve(256); RegAllocHints.reserve(256); - RegClass2VRegMap.resize(TRI.getNumRegClasses()+1); // RC ID starts at 1. + RegClass2VRegMap = new std::vector<unsigned>[TRI.getNumRegClasses()]; UsedPhysRegs.resize(TRI.getNumRegs()); // Create the physreg use/def lists. @@ -52,7 +52,7 @@ MachineRegisterInfo::setRegClass(unsigned Reg, const TargetRegisterClass *RC) { // Remove from old register class's vregs list. This may be slow but // fortunately this operation is rarely needed. std::vector<unsigned> &VRegs = RegClass2VRegMap[OldRC->getID()]; - std::vector<unsigned>::iterator I=std::find(VRegs.begin(), VRegs.end(), VR); + std::vector<unsigned>::iterator I = std::find(VRegs.begin(), VRegs.end(), VR); VRegs.erase(I); // Add to new register class's vregs list. |

