X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=utils%2FTableGen%2FAsmWriterEmitter.cpp;h=a7fc7f3c3ea688ba3331d4f078d47a9b67cabc8a;hp=10864246abda3b32f41cfc01a044449bb75a1bcd;hb=abfd63051d58992d37729a960d319a1eeeec32ae;hpb=cdef20c37c0d34afe7101a5163db8d9d9790cb44;ds=sidebyside diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index 10864246abd..a7fc7f3c3ea 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -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