[PATCH] TableGen/MCInstPrinter: Generate a method to print complete machine Operands using the Target's PrintMethods

Ahmed Bougacha ahmed.bougacha at gmail.com
Mon Nov 11 13:43:11 PST 2013


This patch generates an MCInstPrinter method to print arbitrary
operands without needing to know the specific PrintMethod associated
with the Operand, and using only the Operand type (as defined by the
other patch).
The method is optional, so I added the necessary bits to have it in X86 and ARM.

Suggestions are obviously very welcome, especially on 1) the name, 2)
whether to keep it #ifdef'd and optional or to make it pure virtual in
MCInstPrinter.

Thanks again,
- Ahmed

---
 docs/WritingAnLLVMBackend.rst                      | 25 ++++++++
 include/llvm/MC/MCInstPrinter.h                    |  5 ++
 lib/MC/MCInstPrinter.cpp                           |  5 ++
 lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp      |  1 +
 lib/Target/ARM/InstPrinter/ARMInstPrinter.h        |  2 +
 lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.h      |  1 +
 lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp   |  1 +
 lib/Target/X86/InstPrinter/X86ATTInstPrinter.h     |  2 +
 lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp |  1 +
 lib/Target/X86/InstPrinter/X86IntelInstPrinter.h   |  2 +
 lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h      |  1 +
 utils/TableGen/AsmWriterEmitter.cpp                | 68 ++++++++++++++++++++++
 12 files changed, 114 insertions(+)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-TableGen-Generate-a-printMachineOperand-method-takin.patch
Type: application/octet-stream
Size: 11024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131111/4ea3df95/attachment.obj>


More information about the llvm-commits mailing list