mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-07 16:54:48 +00:00
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
This commit is contained in:
parent
6e7aeb16fa
commit
fe666a3592
@ -102,13 +102,12 @@ public:
|
|||||||
/// machine instruction. Returns true if there was a kill
|
/// machine instruction. Returns true if there was a kill
|
||||||
/// corresponding to this instruction, false otherwise.
|
/// corresponding to this instruction, false otherwise.
|
||||||
bool removeKill(MachineInstr *MI) {
|
bool removeKill(MachineInstr *MI) {
|
||||||
for (std::vector<MachineInstr*>::iterator i = Kills.begin(),
|
std::vector<MachineInstr*>::iterator
|
||||||
e = Kills.end(); i != e; ++i)
|
I = std::find(Kills.begin(), Kills.end(), MI);
|
||||||
if (*i == MI) {
|
if (I == Kills.end())
|
||||||
Kills.erase(i);
|
return false;
|
||||||
return true;
|
Kills.erase(I);
|
||||||
}
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void dump() const;
|
void dump() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user