[PATCH] TableGen: Generate an enum for all named Operand types

Quentin Colombet qcolombet at apple.com
Tue Nov 12 09:59:30 PST 2013

Hi Ahmed,

The code looks fine to me, but the additional documentation is a bit too short.

+TableGen will also generate an enumeration consisting of all named Operand
+types defined in the backend, in the llvm::XXX::OpTypes namespace.

Indeed, I am not sure that it is clear that "types defined in the backend" are the derived types in the backend. In my opinion the proposed phrasing would suffix if and only if there is an example to illustrate it.
Unfortunately, you cannot reuse the XNORrr example as it does not have such types. You have to add one.

Out of curiosity, for your mapping how the “regular” types are mapped?


On Nov 11, 2013, at 1:42 PM, Ahmed Bougacha <ahmed.bougacha at gmail.com> wrote:

> Hi Quentin, all,
> Here's the next patch I had waiting for review.
> In some situations it's very useful to have access to an enum of all
> operand types (that is, instances of Operand in the target's tablegen
> files).
> My use for this is associating MI/SD-pattern level operands with the
> underlying list of MC operand, and keeping track of that association.
> I also sent a nice-to-have feature implemented in another email
> (complete machine operand printing) that was very helpful for
> debugging and testing.
> Thanks!
> - Ahmed
> ---
> docs/WritingAnLLVMBackend.rst       |  3 +++
> utils/TableGen/InstrInfoEmitter.cpp | 31 +++++++++++++++++++++++++++++++
> 2 files changed, 34 insertions(+)
> <0001-TableGen-Generate-an-enum-for-all-named-Operand-type.patch>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131112/4832b473/attachment.html>

More information about the llvm-commits mailing list