[PATCH] D46054: [TableGen] Add a general-purpose JSON backend.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 08:20:49 PDT 2018


simon_tatham updated this revision to Diff 144564.
simon_tatham added a comment.

OK, here's my second draft. Changes since last time:

- thrown out the ad-hoc JSON emitter in favour of the new JSON library in https://reviews.llvm.org/D45753  (also requires the integer-handling followup patch https://reviews.llvm.org/D46209 )
- moved the new source file into `lib/TableGen` where clang-tblgen will be able to get at it more easily (but I haven't actually added it to clang-tblgen yet)
- removed all the type and abstract class information, leaving only the concrete records and a couple of pieces of metadata that I know backends do actually want (list of `field` keywords, list of superclasses, list of instances of each class). Exotic subclasses of Init are now rendered as `kind="complex"` with only a printable representation.
- flattened the JSON structure by several layers to make it more convenient to consume
- added documentation of the format.

I think from //my// perspective this is no longer an unfinished draft; I'd be happy to commit it in this state, subject to code review approval and its dependencies landing.


https://reviews.llvm.org/D46054

Files:
  docs/TableGen/BackEnds.rst
  docs/TableGen/index.rst
  include/llvm/TableGen/Record.h
  lib/TableGen/CMakeLists.txt
  lib/TableGen/JSONBackend.cpp
  test/TableGen/JSON-check.py
  test/TableGen/JSON.td
  utils/TableGen/TableGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46054.144564.patch
Type: text/x-patch
Size: 20578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180430/9aa24d35/attachment.bin>


More information about the llvm-commits mailing list