aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/VirtRegMap.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-02-21 02:22:03 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-02-21 02:22:03 +0000
commit957840b3e14938fc86c306fda99ac039d1777a4c (patch)
tree0bb7804eb32b027f8c9e5e1f3bd54d091018641a /lib/CodeGen/VirtRegMap.cpp
parente549c4940c414521ea4872f0da2ebcfe510f5317 (diff)
Use BitVector instead. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34460 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.cpp')
-rw-r--r--lib/CodeGen/VirtRegMap.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 8a35b1dee1..d5e10efa15 100644
--- a/lib/CodeGen/VirtRegMap.cpp
+++ b/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