[PATCH] D14257: [AsmParser] Generalize matching for grammars without mnemonic-lead statements.

Colin LeMahieu via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 5 08:34:07 PST 2016


colinl added a comment.

Most but not all instructions have mnemonics e.g. "r0 = r1".  Lots have what appear to be a mnemonic but actually isn't "if (p0) r0 = add(r1, r2)" a large swath of instructions start with 'if' but that's not actually the mnemonic.  The version of the parser we had internally before this version did as you suggested, it searched for a string token in the operand list, added a dummy operand to the end and sliced the head operands off and put them after the dummy value.  The asm parser did a similar thing and once matched, it would go back through the MCInst and reorder the operands to the correct position.

This required what I thought was an extremely nasty hack to AsmMatcherEmitter and confusing code in the parser and I rewrote it to the current version contained in these patches.


Repository:
  rL LLVM

http://reviews.llvm.org/D14257





More information about the llvm-commits mailing list