diff options
author | Chris Lattner <sabre@nondot.org> | 2004-01-31 21:27:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-01-31 21:27:19 +0000 |
commit | ef09c63e7ba5dd5410655f71d35eb7245893b1f1 (patch) | |
tree | 541b7866876ad09b3d3f4d699fd5a57a8126afa4 | |
parent | 6b5076790579476f4e4325e25332dacd8fc3d088 (diff) |
Finegrainify namespacification, use new MRegisterInfo::isVirtualRegister
method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11037 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/RegAllocLocal.cpp | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index 845af13a30..45b9ba8f2b 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -58,7 +58,7 @@ MachineBasicBlock *LiveVariables::getIndexMachineBasicBlock(unsigned Idx) { } LiveVariables::VarInfo &LiveVariables::getVarInfo(unsigned RegIdx) { - assert(RegIdx >= MRegisterInfo::FirstVirtualRegister && + assert(MRegisterInfo::isVirtualRegister(RegIdx) && "getVarInfo: not a virtual register!"); RegIdx -= MRegisterInfo::FirstVirtualRegister; if (RegIdx >= VirtRegInfo.size()) { diff --git a/lib/CodeGen/RegAllocLocal.cpp b/lib/CodeGen/RegAllocLocal.cpp index 5ffe5afc4d..680bda7cdc 100644 --- a/lib/CodeGen/RegAllocLocal.cpp +++ b/lib/CodeGen/RegAllocLocal.cpp @@ -25,8 +25,7 @@ #include "Support/Debug.h" #include "Support/Statistic.h" #include <iostream> - -namespace llvm { +using namespace llvm; namespace { Statistic<> NumSpilled ("ra-local", "Number of registers spilled"); @@ -75,14 +74,14 @@ namespace { std::vector<bool> VirtRegModified; void markVirtRegModified(unsigned Reg, bool Val = true) { - assert(Reg >= MRegisterInfo::FirstVirtualRegister && "Illegal VirtReg!"); + assert(MRegisterInfo::isVirtualRegister(Reg) && "Illegal VirtReg!"); Reg -= MRegisterInfo::FirstVirtualRegister; if (VirtRegModified.size() <= Reg) VirtRegModified.resize(Reg+1); VirtRegModified[Reg] = Val; } bool isVirtRegModified(unsigned Reg) const { - assert(Reg >= MRegisterInfo::FirstVirtualRegister && "Illegal VirtReg!"); + assert(MRegisterInfo::isVirtualRegister(Reg) && "Illegal VirtReg!"); assert(Reg - MRegisterInfo::FirstVirtualRegister < VirtRegModified.size() && "Illegal virtual register!"); return VirtRegModified[Reg - MRegisterInfo::FirstVirtualRegister]; @@ -524,7 +523,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { KE = LV->killed_end(MI); KI != KE; ++KI) { unsigned VirtReg = KI->second; unsigned PhysReg = VirtReg; - if (VirtReg >= MRegisterInfo::FirstVirtualRegister) { + if (MRegisterInfo::isVirtualRegister(VirtReg)) { std::map<unsigned, unsigned>::iterator I = Virt2PhysRegMap.find(VirtReg); assert(I != Virt2PhysRegMap.end()); @@ -602,7 +601,7 @@ void RA::AllocateBasicBlock(MachineBasicBlock &MBB) { KE = LV->dead_end(MI); KI != KE; ++KI) { unsigned VirtReg = KI->second; unsigned PhysReg = VirtReg; - if (VirtReg >= MRegisterInfo::FirstVirtualRegister) { + if (MRegisterInfo::isVirtualRegister(VirtReg)) { std::map<unsigned, unsigned>::iterator I = Virt2PhysRegMap.find(VirtReg); assert(I != Virt2PhysRegMap.end()); @@ -668,8 +667,7 @@ bool RA::runOnMachineFunction(MachineFunction &Fn) { return true; } -FunctionPass *createLocalRegisterAllocator() { +FunctionPass *llvm::createLocalRegisterAllocator() { return new RA(); } -} // End llvm namespace |