summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorDylan Noblesmith <nobled@dreamwidth.org>2014-08-25 01:59:42 +0000
committerDylan Noblesmith <nobled@dreamwidth.org>2014-08-25 01:59:42 +0000
commit46a922c191142f00fb26cb971e72ee7cb95c33b4 (patch)
tree40f19826c0d3e84611fe43bbaf6220ec9d427775 /llvm/lib/CodeGen/LiveVariables.cpp
parentb899464f5ba0b71623611303112c323ad2f2a6c0 (diff)
downloadbcm5719-llvm-46a922c191142f00fb26cb971e72ee7cb95c33b4.tar.gz
bcm5719-llvm-46a922c191142f00fb26cb971e72ee7cb95c33b4.zip
CodeGen/LiveVariables: switch to std::vector
No functionality change. llvm-svn: 216367
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index 068c7695a29..bf9791127ed 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/lib/CodeGen/LiveVariables.cpp
@@ -502,12 +502,12 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
MRI = &mf.getRegInfo();
TRI = MF->getSubtarget().getRegisterInfo();
- unsigned NumRegs = TRI->getNumRegs();
- PhysRegDef = new MachineInstr*[NumRegs];
- PhysRegUse = new MachineInstr*[NumRegs];
- PHIVarInfo = new SmallVector<unsigned, 4>[MF->getNumBlockIDs()];
- std::fill(PhysRegDef, PhysRegDef + NumRegs, nullptr);
- std::fill(PhysRegUse, PhysRegUse + NumRegs, nullptr);
+ const unsigned NumRegs = TRI->getNumRegs();
+ PhysRegDef.clear();
+ PhysRegUse.clear();
+ PhysRegDef.resize(NumRegs, nullptr);
+ PhysRegUse.resize(NumRegs, nullptr);
+ PHIVarInfo.resize(MF->getNumBlockIDs());
PHIJoins.clear();
// FIXME: LiveIntervals will be updated to remove its dependence on
@@ -637,8 +637,10 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
if ((PhysRegDef[i] || PhysRegUse[i]) && !LiveOuts.count(i))
HandlePhysRegDef(i, nullptr, Defs);
- std::fill(PhysRegDef, PhysRegDef + NumRegs, nullptr);
- std::fill(PhysRegUse, PhysRegUse + NumRegs, nullptr);
+ PhysRegDef.clear();
+ PhysRegUse.clear();
+ PhysRegDef.resize(NumRegs, nullptr);
+ PhysRegUse.resize(NumRegs, nullptr);
}
// Convert and transfer the dead / killed information we have gathered into
@@ -660,9 +662,9 @@ bool LiveVariables::runOnMachineFunction(MachineFunction &mf) {
assert(Visited.count(&*i) != 0 && "unreachable basic block found");
#endif
- delete[] PhysRegDef;
- delete[] PhysRegUse;
- delete[] PHIVarInfo;
+ PhysRegDef.clear();
+ PhysRegUse.clear();
+ PHIVarInfo.clear();
return false;
}
OpenPOWER on IntegriCloud