[llvm-commits] [llvm] r53063 - /llvm/trunk/lib/CodeGen/LiveVariables.cpp

Evan Cheng evan.cheng at apple.com
Wed Jul 2 17:28:27 PDT 2008


Author: evancheng
Date: Wed Jul  2 19:28:27 2008
New Revision: 53063

URL: http://llvm.org/viewvc/llvm-project?rev=53063&view=rev
Log:
Use std::replace instead of std::find and push_back.

Modified:
    llvm/trunk/lib/CodeGen/LiveVariables.cpp

Modified: llvm/trunk/lib/CodeGen/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveVariables.cpp?rev=53063&r1=53062&r2=53063&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/LiveVariables.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveVariables.cpp Wed Jul  2 19:28:27 2008
@@ -689,8 +689,7 @@
 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





More information about the llvm-commits mailing list