diff options
author | John McCall <rjmccall@apple.com> | 2019-10-01 23:13:03 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2019-10-01 23:13:03 +0000 |
commit | a82d2fe94427f3122ecf94549b5f7f4c57b7b913 (patch) | |
tree | 640e5db65e07c7edcdca9550abf6b1ee7ce5220f /clang/utils/TableGen/TableGen.cpp | |
parent | c45f8d49897f1068676b8ba8e204d789fc6ceaea (diff) | |
download | bcm5719-llvm-a82d2fe94427f3122ecf94549b5f7f4c57b7b913.tar.gz bcm5719-llvm-a82d2fe94427f3122ecf94549b5f7f4c57b7b913.zip |
Emit TypeNodes.def with tblgen.
The primary goal here is to make the type node hierarchy available to
other tblgen backends, although it should also make it easier to generate
more selective x-macros in the future.
Because tblgen doesn't seem to allow backends to preserve the source
order of defs, this is not NFC because it significantly re-orders IDs.
I've fixed the one (fortunately obvious) place where we relied on
the old order. Unfortunately, I wasn't able to share code with the
existing AST-node x-macro generators because the x-macro schema we use
for types is different in a number of ways. The main loss is that
subclasses aren't ordered together, which doesn't seem important for
types because the hierarchy is generally very shallow with little
clustering.
llvm-svn: 373407
Diffstat (limited to 'clang/utils/TableGen/TableGen.cpp')
-rw-r--r-- | clang/utils/TableGen/TableGen.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/utils/TableGen/TableGen.cpp b/clang/utils/TableGen/TableGen.cpp index a9237001933..d0f8a756449 100644 --- a/clang/utils/TableGen/TableGen.cpp +++ b/clang/utils/TableGen/TableGen.cpp @@ -47,6 +47,7 @@ enum ActionType { GenClangCommentNodes, GenClangDeclNodes, GenClangStmtNodes, + GenClangTypeNodes, GenClangOpcodes, GenClangSACheckers, GenClangCommentHTMLTags, @@ -130,6 +131,8 @@ cl::opt<ActionType> Action( "Generate Clang AST declaration nodes"), clEnumValN(GenClangStmtNodes, "gen-clang-stmt-nodes", "Generate Clang AST statement nodes"), + clEnumValN(GenClangTypeNodes, "gen-clang-type-nodes", + "Generate Clang AST type nodes"), clEnumValN(GenClangOpcodes, "gen-clang-opcodes", "Generate Clang constexpr interpreter opcodes"), clEnumValN(GenClangSACheckers, "gen-clang-sa-checkers", @@ -254,6 +257,9 @@ bool ClangTableGenMain(raw_ostream &OS, RecordKeeper &Records) { case GenClangStmtNodes: EmitClangASTNodes(Records, OS, "Stmt", ""); break; + case GenClangTypeNodes: + EmitClangTypeNodes(Records, OS); + break; case GenClangOpcodes: EmitClangOpcodes(Records, OS); break; |