aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineOutliner.cpp
diff options
context:
space:
mode:
authorJessica Paquette <jpaquette@apple.com>2018-12-06 00:26:21 +0000
committerJessica Paquette <jpaquette@apple.com>2018-12-06 00:26:21 +0000
commit3cd70b385df8d2f9b4de6165f17b4a07649d2f07 (patch)
tree16afe84c6a0b6fe2c36f15bc5a0f6d48cb29943e /llvm/lib/CodeGen/MachineOutliner.cpp
parentcb447a260446de91592227643e4775bd2fe54f2e (diff)
downloadllvm-3cd70b385df8d2f9b4de6165f17b4a07649d2f07.zip
llvm-3cd70b385df8d2f9b4de6165f17b4a07649d2f07.tar.gz
llvm-3cd70b385df8d2f9b4de6165f17b4a07649d2f07.tar.bz2
[MachineOutliner][NFC] Move yet another std::vector out of a loop
Once again, following the wisdom of the LLVM Programmer's Manual. I think that's enough refactoring for today. :) llvm-svn: 348439
Diffstat (limited to 'llvm/lib/CodeGen/MachineOutliner.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineOutliner.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineOutliner.cpp b/llvm/lib/CodeGen/MachineOutliner.cpp
index c5f4766..a99f85f 100644
--- a/llvm/lib/CodeGen/MachineOutliner.cpp
+++ b/llvm/lib/CodeGen/MachineOutliner.cpp
@@ -519,18 +519,19 @@ public:
RS = RepeatedSubstring();
N = nullptr;
+ // Each leaf node represents a repeat of a string.
+ std::vector<SuffixTreeNode *> LeafChildren;
+
// Continue visiting nodes until we find one which repeats more than once.
while (!ToVisit.empty()) {
SuffixTreeNode *Curr = ToVisit.back();
ToVisit.pop_back();
+ LeafChildren.clear();
// Keep track of the length of the string associated with the node. If
// it's too short, we'll quit.
unsigned Length = Curr->ConcatLen;
- // Each leaf node represents a repeat of a string.
- std::vector<SuffixTreeNode *> LeafChildren;
-
// Iterate over each child, saving internal nodes for visiting, and
// leaf nodes in LeafChildren. Internal nodes represent individual
// strings, which may repeat.