OSDN Git Service

[SchedModel] Use std::move to replace a vector instead of vector::swap
authorCraig Topper <craig.topper@intel.com>
Sat, 24 Mar 2018 22:58:00 +0000 (22:58 +0000)
committerCraig Topper <craig.topper@intel.com>
Sat, 24 Mar 2018 22:58:00 +0000 (22:58 +0000)
We don't really care about the old vector value so we don't care to swap it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328440 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenSchedule.cpp

index cd8f3e8..466e915 100644 (file)
@@ -710,7 +710,7 @@ unsigned CodeGenSchedModels::addSchedClass(Record *ItinClassDef,
                    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();