diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-02-21 02:22:03 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-02-21 02:22:03 +0000 |
commit | de037a821a262e4adc968c52b9adda73496511ea (patch) | |
tree | 24df1819b1c4491ffd0f7688c66379d68f1894de /llvm/lib | |
parent | 74cf82e5221f9c0010910cd8da563addfadf9948 (diff) | |
download | bcm5719-llvm-de037a821a262e4adc968c52b9adda73496511ea.tar.gz bcm5719-llvm-de037a821a262e4adc968c52b9adda73496511ea.zip |
Use BitVector instead. No functionality change.
llvm-svn: 34460
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/VirtRegMap.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/VirtRegMap.cpp b/llvm/lib/CodeGen/VirtRegMap.cpp index 8a35b1dee18..d5e10efa15e 100644 --- a/llvm/lib/CodeGen/VirtRegMap.cpp +++ b/llvm/lib/CodeGen/VirtRegMap.cpp @@ -27,6 +27,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Compiler.h" +#include "llvm/ADT/BitVector.h" #include "llvm/ADT/Statistic.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallSet.h" @@ -423,14 +424,10 @@ namespace { class VISIBILITY_HIDDEN ReuseInfo { MachineInstr &MI; std::vector<ReusedOp> Reuses; - bool *PhysRegsClobbered; + BitVector PhysRegsClobbered; public: ReuseInfo(MachineInstr &mi, const MRegisterInfo *mri) : MI(mi) { - PhysRegsClobbered = new bool[mri->getNumRegs()]; - std::fill(PhysRegsClobbered, PhysRegsClobbered+mri->getNumRegs(), false); - } - ~ReuseInfo() { - delete[] PhysRegsClobbered; + PhysRegsClobbered.resize(mri->getNumRegs()); } bool hasReuses() const { @@ -452,11 +449,11 @@ namespace { } void markClobbered(unsigned PhysReg) { - PhysRegsClobbered[PhysReg] = true; + PhysRegsClobbered.set(PhysReg); } bool isClobbered(unsigned PhysReg) const { - return PhysRegsClobbered[PhysReg]; + return PhysRegsClobbered.test(PhysReg); } /// GetRegForReload - We are about to emit a reload into PhysReg. If there |