Changes in directory llvm/utils/TableGen:
AsmWriterEmitter.cpp updated: 1.34 -> 1.35 --- Log message: Handle the last operand more intelligently. When emitting the \n, also return from the asmprinter to make the generated asmprinter both more efficient and smaller. --- Diffs of the changes: (+7 -5) AsmWriterEmitter.cpp | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) Index: llvm/utils/TableGen/AsmWriterEmitter.cpp diff -u llvm/utils/TableGen/AsmWriterEmitter.cpp:1.34 llvm/utils/TableGen/AsmWriterEmitter.cpp:1.35 --- llvm/utils/TableGen/AsmWriterEmitter.cpp:1.34 Tue Jul 18 12:43:54 2006 +++ llvm/utils/TableGen/AsmWriterEmitter.cpp Tue Jul 18 12:50:22 2006 @@ -345,12 +345,14 @@ if (Inst == 0) continue; // PHI, INLINEASM, etc. std::string Command; - if (Op > Inst->Operands.size()) + if (Op >= Inst->Operands.size()) continue; // Instruction already done. - else if (Op == Inst->Operands.size()) - Command = " return true;\n"; - else - Command = " " + Inst->Operands[Op].getCode() + "\n"; + + Command = " " + Inst->Operands[Op].getCode() + "\n"; + + // If this is the last operand, emit a return. + if (Op == Inst->Operands.size()-1) + Command += " return true;\n"; // Check to see if we already have 'Command' in UniqueOperandCommands. // If not, add it. _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits