mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-18 10:24:45 +00:00
Start TargetRegisterClass indices at 0 instead of 1, so that
MachineRegisterInfo doesn't have to confusingly allocate an extra entry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106296 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user