CodeGenSchedule: Use resize instead of copying a vector
authorArnold Schwaighofer <aschwaighofer@apple.com>
Fri, 7 Jun 2013 00:04:30 +0000 (00:04 +0000)
committerArnold Schwaighofer <aschwaighofer@apple.com>
Fri, 7 Jun 2013 00:04:30 +0000 (00:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183465 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenSchedule.cpp

index 53b72d03b5b4f898236b1161833516f5094056bd..da16852df55d176d3e7ad5466225ee9ab46a3dd0 100644 (file)
@@ -1173,8 +1173,8 @@ pushVariant(const TransVariant &VInfo, bool IsRead) {
     // Make N-1 copies of this transition's last sequence.
     for (unsigned i = 1, e = SelectedRWs.size(); i != e; ++i) {
       // Create a temporary copy the vector could reallocate.
-      SmallVector<unsigned, 4> Tmp = RWSequences[OperIdx];
-      RWSequences.push_back(Tmp);
+      RWSequences.reserve(RWSequences.size() + 1);
+      RWSequences.push_back(RWSequences[OperIdx]);
     }
     // Push each of the N elements of the SelectedRWs onto a copy of the last
     // sequence (split the current operand into N operands).