diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-07-03 00:28:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-07-03 00:28:27 +0000 |
commit | 5b9f60bc22582e80b081d4277a47d8b7fa14e3f4 (patch) | |
tree | 14a7e5131a4445b01c22bb81061c8d5cc34ee858 /lib/CodeGen/LiveVariables.cpp | |
parent | 825cb98d9a9a28c007d6a10d5ebec858e669a685 (diff) | |
download | external_llvm-5b9f60bc22582e80b081d4277a47d8b7fa14e3f4.zip external_llvm-5b9f60bc22582e80b081d4277a47d8b7fa14e3f4.tar.gz external_llvm-5b9f60bc22582e80b081d4277a47d8b7fa14e3f4.tar.bz2 |
Use std::replace instead of std::find and push_back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveVariables.cpp')
-rw-r--r-- | lib/CodeGen/LiveVariables.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index ee4492b..1689915 100644 --- a/lib/CodeGen/LiveVariables.cpp +++ b/lib/CodeGen/LiveVariables.cpp @@ -689,8 +689,7 @@ void LiveVariables::instructionChanged(MachineInstr *OldMI, void LiveVariables::replaceKillInstruction(unsigned Reg, MachineInstr *OldMI, MachineInstr *NewMI) { VarInfo &VI = getVarInfo(Reg); - if (VI.removeKill(OldMI)) - VI.Kills.push_back(NewMI); // Yes, there was a kill of it + std::replace(VI.Kills.begin(), VI.Kills.end(), OldMI, NewMI); } /// removeVirtualRegistersKilled - Remove all killed info for the specified |