[llvm] r348433 - [MachineOutliner][NFC] Move std::vector out of loop

Jessica Paquette via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 5 16:04:03 PST 2018


Author: paquette
Date: Wed Dec  5 16:04:03 2018
New Revision: 348433

URL: http://llvm.org/viewvc/llvm-project?rev=348433&view=rev
Log:
[MachineOutliner][NFC] Move std::vector out of loop

See http://llvm.org/docs/ProgrammersManual.html#vector

Modified:
    llvm/trunk/lib/CodeGen/MachineOutliner.cpp

Modified: llvm/trunk/lib/CodeGen/MachineOutliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineOutliner.cpp?rev=348433&r1=348432&r2=348433&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineOutliner.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineOutliner.cpp Wed Dec  5 16:04:03 2018
@@ -1015,9 +1015,10 @@ MachineOutliner::findCandidates(Instruct
 
   // 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;




More information about the llvm-commits mailing list