llvm.org GIT mirror llvm / fe666a3
Improve VarInfo::removeKill() by using std::find instead of linear search. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48321 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 12 years ago
1 changed file(s) with 6 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
101101 /// machine instruction. Returns true if there was a kill
102102 /// corresponding to this instruction, false otherwise.
103103 bool removeKill(MachineInstr *MI) {
104 for (std::vector::iterator i = Kills.begin(),
105 e = Kills.end(); i != e; ++i)
106 if (*i == MI) {
107 Kills.erase(i);
108 return true;
109 }
110 return false;
104 std::vector::iterator
105 I = std::find(Kills.begin(), Kills.end(), MI);
106 if (I == Kills.end())
107 return false;
108 Kills.erase(I);
109 return true;
111110 }
112111
113112 void dump() const;