summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDylan Noblesmith <nobled@dreamwidth.org>2014-08-25 01:59:36 +0000
committerDylan Noblesmith <nobled@dreamwidth.org>2014-08-25 01:59:36 +0000
commit6076debd98fef002b4f0147980c39114b8a0fef0 (patch)
tree979240db7241db963ff2ec0649588f0995d8bd47 /llvm/lib
parent130589f80436f592722ef9b4be5d381434176177 (diff)
downloadbcm5719-llvm-6076debd98fef002b4f0147980c39114b8a0fef0.tar.gz
bcm5719-llvm-6076debd98fef002b4f0147980c39114b8a0fef0.zip
AArch64: use std::vector for temp array
llvm-svn: 216365
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64CollectLOH.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp b/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp
index f621a28c802..38dbeb95927 100644
--- a/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp
+++ b/llvm/lib/Target/AArch64/AArch64CollectLOH.cpp
@@ -1071,7 +1071,8 @@ bool AArch64CollectLOH::runOnMachineFunction(MachineFunction &MF) {
bool Modified = false;
// Start with ADRP.
- InstrToInstrs *ColorOpToReachedUses = new InstrToInstrs[NbReg];
+ std::vector<InstrToInstrs> COTRUVector(NbReg);
+ auto ColorOpToReachedUses = COTRUVector.data();
// Compute the reaching def in ADRP mode, meaning ADRP definitions
// are first considered as uses.
@@ -1086,10 +1087,9 @@ bool AArch64CollectLOH::runOnMachineFunction(MachineFunction &MF) {
// Compute LOH for ADRP.
computeADRP(ADRPToReachingDefs, *AArch64FI, MDT);
- delete[] ColorOpToReachedUses;
-
// Continue with general ADRP -> ADD/LDR -> LDR/STR pattern.
- ColorOpToReachedUses = new InstrToInstrs[NbReg];
+ COTRUVector.clear();
+ COTRUVector.resize(NbReg);
// first perform a regular reaching def analysis.
reachingDef(MF, ColorOpToReachedUses, RegToId, false, DummyOp);
@@ -1103,7 +1103,6 @@ bool AArch64CollectLOH::runOnMachineFunction(MachineFunction &MF) {
// Compute other than AdrpAdrp LOH.
computeOthers(UsesToReachingDefs, ColorOpToReachedUses, *AArch64FI, RegToId,
MDT);
- delete[] ColorOpToReachedUses;
if (BasicBlockScopeOnly)
MF.DeleteMachineInstr(DummyOp);
OpenPOWER on IntegriCloud