[PATCH] D71191: [TableGen] Add bang-operators !getop and !setop.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 9 03:15:51 PST 2019


simon_tatham created this revision.
simon_tatham added reviewers: hfinkel, nhaehnle.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

These allow you to get and set the operator of a dag node, without
affecting its list of arguments.

`!getop` is slightly fiddly because in many contexts you need its
return value to have a static type more specific than 'any record'. It
works to say `!cast<BaseClass>(!getop(...))`, but it's cumbersome, so
I made `!getop` take an optional type suffix itself, so that can be
written as the shorter `!getop<BaseClass>(...)`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71191

Files:
  llvm/docs/TableGen/LangIntro.rst
  llvm/docs/TableGen/LangRef.rst
  llvm/include/llvm/TableGen/Record.h
  llvm/lib/TableGen/Record.cpp
  llvm/lib/TableGen/TGLexer.cpp
  llvm/lib/TableGen/TGLexer.h
  llvm/lib/TableGen/TGParser.cpp
  llvm/test/TableGen/getsetop.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71191.232792.patch
Type: text/x-patch
Size: 11786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191209/6d8533b8/attachment.bin>


More information about the llvm-commits mailing list