From c2c8ebb7a73489bdc18da99aa3c2d180d200346c Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 3 Jul 2008 00:28:27 +0000 Subject: 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 --- lib/CodeGen/LiveVariables.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/CodeGen/LiveVariables.cpp') diff --git a/lib/CodeGen/LiveVariables.cpp b/lib/CodeGen/LiveVariables.cpp index ee4492b6dd..16899153fb 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 -- cgit v1.2.3