[PATCH] D50771: [clang-tblgen] Add -print-records and -dump-json modes.
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 22 02:21:34 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL340390: [clang-tblgen] Add -print-records and -dump-json modes. (authored by statham, committed by ).
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
https://reviews.llvm.org/D50771
Files:
cfe/trunk/utils/TableGen/TableGen.cpp
Index: cfe/trunk/utils/TableGen/TableGen.cpp
===================================================================
--- cfe/trunk/utils/TableGen/TableGen.cpp
+++ cfe/trunk/utils/TableGen/TableGen.cpp
@@ -23,6 +23,8 @@
using namespace clang;
enum ActionType {
+ PrintRecords,
+ DumpJSON,
GenClangAttrClasses,
GenClangAttrParserStringSwitches,
GenClangAttrSubjectMatchRulesParserStringSwitches,
@@ -66,6 +68,10 @@
cl::opt<ActionType> Action(
cl::desc("Action to perform:"),
cl::values(
+ clEnumValN(PrintRecords, "print-records",
+ "Print all records to stdout (default)"),
+ clEnumValN(DumpJSON, "dump-json",
+ "Dump all records as machine-readable JSON"),
clEnumValN(GenClangAttrClasses, "gen-clang-attr-classes",
"Generate clang attribute clases"),
clEnumValN(GenClangAttrParserStringSwitches,
@@ -164,6 +170,12 @@
bool ClangTableGenMain(raw_ostream &OS, RecordKeeper &Records) {
switch (Action) {
+ case PrintRecords:
+ OS << Records; // No argument, dump all contents
+ break;
+ case DumpJSON:
+ EmitJSON(Records, OS);
+ break;
case GenClangAttrClasses:
EmitClangAttrClass(Records, OS);
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50771.161904.patch
Type: text/x-patch
Size: 1251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180822/b3e6c69e/attachment.bin>
More information about the llvm-commits
mailing list