[llvm] r328440 - [SchedModel] Use std::move to replace a vector instead of vector::swap

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 24 15:58:01 PDT 2018


Author: ctopper
Date: Sat Mar 24 15:58:00 2018
New Revision: 328440

URL: http://llvm.org/viewvc/llvm-project?rev=328440&view=rev
Log:
[SchedModel] Use std::move to replace a vector instead of vector::swap

We don't really care about the old vector value so we don't care to swap it.

Modified:
    llvm/trunk/utils/TableGen/CodeGenSchedule.cpp

Modified: llvm/trunk/utils/TableGen/CodeGenSchedule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenSchedule.cpp?rev=328440&r1=328439&r2=328440&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenSchedule.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenSchedule.cpp Sat Mar 24 15:58:00 2018
@@ -710,7 +710,7 @@ unsigned CodeGenSchedModels::addSchedCla
                    SchedClasses[Idx].ProcIndices.end(),
                    ProcIndices.begin(), ProcIndices.end(),
                    std::back_inserter(PI));
-    SchedClasses[Idx].ProcIndices.swap(PI);
+    SchedClasses[Idx].ProcIndices = std::move(PI);
     return Idx;
   }
   Idx = SchedClasses.size();




More information about the llvm-commits mailing list