[PATCH] [Tablegen] Fix alias instruction printer mangling opcodes with optional suffixes.

Matthew Wahab matthew.wahab at arm.com
Thu Dec 4 08:21:15 PST 2014


Log:
---
[Tablegen] Fix alias instruction printer mangling opcodes with optional suffixes. 

The generic printer will now properly print AsmString formats such as
"opcode${a}${b} operands".

This introduces a slight change in behaviour: a tab is printed for the first
whitespace after the opcode and suffixes part. Previously, a tab would always be
printed after the opcode.

Summary:
---
An instruction alias defined with InstAlias and an optional operand immediately
after the opcode, "<opcode>${a} <operands>", would get the optional operand
emitted as unprintable characters in the instrution disassembly. This wouldn't
happen if the optional operand appeared as the last item in the AsmString which
is how the current backends avoided the problem.

There don't appear to be any tests for this part of Tablegen but it passes the
pre-commit tests. Manually tested the change by enabling the generic alias
printer in the ARM backend and checking the output.

http://reviews.llvm.org/D6530

Files:
  utils/TableGen/AsmWriterEmitter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6530.16930.patch
Type: text/x-patch
Size: 1666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141204/d791e704/attachment.bin>


More information about the llvm-commits mailing list