summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PeepholeOptimizer.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2015-02-28 10:11:12 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2015-02-28 10:11:12 +0000
commit31fbd9f7b00356d2128b644b99dc8f9d7f32e976 (patch)
treef28b18ca349c88d73dca9347740830ca663d894f /lib/CodeGen/PeepholeOptimizer.cpp
parent12d1e53db88a9d68f75b6ff42b59669c7adec7b1 (diff)
downloadllvm-31fbd9f7b00356d2128b644b99dc8f9d7f32e976.tar.gz
Replace std::copy with a back inserter with vector append where feasible
All of the cases were just appending from random access iterators to a vector. Using insert/append can grow the vector to the perfect size directly and moves the growing out of the loop. No intended functionalty change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230845 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PeepholeOptimizer.cpp')
-rw-r--r--lib/CodeGen/PeepholeOptimizer.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/PeepholeOptimizer.cpp b/lib/CodeGen/PeepholeOptimizer.cpp
index 283d1f26198b..2800d846ff39 100644
--- a/lib/CodeGen/PeepholeOptimizer.cpp
+++ b/lib/CodeGen/PeepholeOptimizer.cpp
@@ -411,8 +411,7 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB,
if (ExtendLife && !ExtendedUses.empty())
// Extend the liveness of the extension result.
- std::copy(ExtendedUses.begin(), ExtendedUses.end(),
- std::back_inserter(Uses));
+ Uses.append(ExtendedUses.begin(), ExtendedUses.end());
// Now replace all uses.
bool Changed = false;