[MachineOutliner][NFC] Move std::vector out of loop
authorJessica Paquette <jpaquette@apple.com>
Thu, 6 Dec 2018 00:04:03 +0000 (00:04 +0000)
committerJessica Paquette <jpaquette@apple.com>
Thu, 6 Dec 2018 00:04:03 +0000 (00:04 +0000)
See http://llvm.org/docs/ProgrammersManual.html#vector

llvm-svn: 348433

llvm/lib/CodeGen/MachineOutliner.cpp

index 06eaf1e..c5f4766 100644 (file)
@@ -1015,9 +1015,10 @@ MachineOutliner::findCandidates(InstructionMapper &Mapper,
 
   // First, find dall of the repeated substrings in the tree of minimum length
   // 2.
+  std::vector<Candidate> CandidatesForRepeatedSeq;
   for (auto It = ST.begin(), Et = ST.end(); It != Et; ++It) {
+    CandidatesForRepeatedSeq.clear();
     SuffixTree::RepeatedSubstring RS = *It;
-    std::vector<Candidate> CandidatesForRepeatedSeq;
     unsigned StringLen = RS.Length;
     for (const unsigned &StartIdx : RS.StartIndices) {
       unsigned EndIdx = StartIdx + StringLen - 1;