[TableGen] Use std::remove_if instead of an n^2 loop. NFC
llvm-svn: 257581
This commit is contained in:
parent
df39060f9f
commit
4f1f11527e
|
@ -478,14 +478,11 @@ void AsmWriterEmitter::EmitPrintInstruction(raw_ostream &O) {
|
|||
}
|
||||
|
||||
// Okay, delete instructions with no operand info left.
|
||||
for (unsigned i = 0, e = Instructions.size(); i != e; ++i) {
|
||||
// Entire instruction has been emitted?
|
||||
AsmWriterInst &Inst = Instructions[i];
|
||||
if (Inst.Operands.empty()) {
|
||||
Instructions.erase(Instructions.begin()+i);
|
||||
--i; --e;
|
||||
}
|
||||
}
|
||||
auto I = std::remove_if(Instructions.begin(), Instructions.end(),
|
||||
[](AsmWriterInst &Inst) {
|
||||
return Inst.Operands.empty();
|
||||
});
|
||||
Instructions.erase(I, Instructions.end());
|
||||
|
||||
|
||||
// Because this is a vector, we want to emit from the end. Reverse all of the
|
||||
|
|
Loading…
Reference in New Issue