summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/TableGen.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/utils/TableGen/TableGen.cpp b/llvm/utils/TableGen/TableGen.cpp
index cf1404d8769..b78260625cb 100644
--- a/llvm/utils/TableGen/TableGen.cpp
+++ b/llvm/utils/TableGen/TableGen.cpp
@@ -24,6 +24,7 @@ using namespace llvm;
enum ActionType {
PrintRecords,
+ DumpJSON,
GenEmitter,
GenRegisterInfo,
GenInstrInfo,
@@ -59,6 +60,8 @@ namespace {
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(GenEmitter, "gen-emitter",
"Generate machine code emitter"),
clEnumValN(GenRegisterInfo, "gen-register-info",
@@ -126,6 +129,9 @@ bool LLVMTableGenMain(raw_ostream &OS, RecordKeeper &Records) {
case PrintRecords:
OS << Records; // No argument, dump all contents
break;
+ case DumpJSON:
+ EmitJSON(Records, OS);
+ break;
case GenEmitter:
EmitCodeEmitter(Records, OS);
break;
OpenPOWER on IntegriCloud