summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveVariables.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-07-03 00:28:27 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-07-03 00:28:27 +0000
commit9f8b66f3f19ca2dd71e3d40dd925d35bf199f68b (patch)
tree34e5b3eb8e626befea298ec58c497a591885d079 /llvm/lib/CodeGen/LiveVariables.cpp
parent7dcfff392aa1749c4e3c447c1acb8dc4e363890b (diff)
downloadbcm5719-llvm-9f8b66f3f19ca2dd71e3d40dd925d35bf199f68b.tar.gz
bcm5719-llvm-9f8b66f3f19ca2dd71e3d40dd925d35bf199f68b.zip
Use std::replace instead of std::find and push_back.
llvm-svn: 53063
Diffstat (limited to 'llvm/lib/CodeGen/LiveVariables.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveVariables.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveVariables.cpp b/llvm/lib/CodeGen/LiveVariables.cpp
index ee4492b6ddc..16899153fb8 100644
--- a/llvm/lib/CodeGen/LiveVariables.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud