xref: /freebsd/contrib/llvm-project/clang/utils/TableGen/TableGen.cpp (revision 1db9f3b21e39176dd5b67cf8ac378633b172463e)
1 //===- TableGen.cpp - Top-Level TableGen implementation for Clang ---------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the main function for Clang's TableGen.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "TableGenBackends.h" // Declares all backends.
14 #include "ASTTableGen.h"
15 #include "llvm/Support/CommandLine.h"
16 #include "llvm/Support/ManagedStatic.h"
17 #include "llvm/Support/PrettyStackTrace.h"
18 #include "llvm/Support/Signals.h"
19 #include "llvm/TableGen/Error.h"
20 #include "llvm/TableGen/Main.h"
21 #include "llvm/TableGen/Record.h"
22 
23 using namespace llvm;
24 using namespace clang;
25 
26 enum ActionType {
27   PrintRecords,
28   DumpJSON,
29   GenClangAttrClasses,
30   GenClangAttrParserStringSwitches,
31   GenClangAttrSubjectMatchRulesParserStringSwitches,
32   GenClangAttrImpl,
33   GenClangAttrList,
34   GenClangAttrCanPrintLeftList,
35   GenClangAttrMustPrintLeftList,
36   GenClangAttrDocTable,
37   GenClangAttrSubjectMatchRuleList,
38   GenClangAttrPCHRead,
39   GenClangAttrPCHWrite,
40   GenClangAttrTokenKinds,
41   GenClangAttrHasAttributeImpl,
42   GenClangAttrSpellingListIndex,
43   GenClangAttrASTVisitor,
44   GenClangAttrTemplateInstantiate,
45   GenClangAttrParsedAttrList,
46   GenClangAttrParsedAttrImpl,
47   GenClangAttrParsedAttrKinds,
48   GenClangAttrTextNodeDump,
49   GenClangAttrNodeTraverse,
50   GenClangBasicReader,
51   GenClangBasicWriter,
52   GenClangDiagsDefs,
53   GenClangDiagGroups,
54   GenClangDiagsIndexName,
55   GenClangCommentNodes,
56   GenClangDeclNodes,
57   GenClangStmtNodes,
58   GenClangTypeNodes,
59   GenClangTypeReader,
60   GenClangTypeWriter,
61   GenClangOpcodes,
62   GenClangSACheckers,
63   GenClangSyntaxNodeList,
64   GenClangSyntaxNodeClasses,
65   GenClangCommentHTMLTags,
66   GenClangCommentHTMLTagsProperties,
67   GenClangCommentHTMLNamedCharacterReferences,
68   GenClangCommentCommandInfo,
69   GenClangCommentCommandList,
70   GenClangOpenCLBuiltins,
71   GenClangOpenCLBuiltinHeader,
72   GenClangOpenCLBuiltinTests,
73   GenArmNeon,
74   GenArmFP16,
75   GenArmBF16,
76   GenArmVectorType,
77   GenArmNeonSema,
78   GenArmNeonTest,
79   GenArmMveHeader,
80   GenArmMveBuiltinDef,
81   GenArmMveBuiltinSema,
82   GenArmMveBuiltinCG,
83   GenArmMveBuiltinAliases,
84   GenArmSveHeader,
85   GenArmSveBuiltins,
86   GenArmSveBuiltinCG,
87   GenArmSveTypeFlags,
88   GenArmSveRangeChecks,
89   GenArmSveStreamingAttrs,
90   GenArmSmeHeader,
91   GenArmSmeBuiltins,
92   GenArmSmeBuiltinCG,
93   GenArmSmeRangeChecks,
94   GenArmSmeStreamingAttrs,
95   GenArmSmeBuiltinZAState,
96   GenArmCdeHeader,
97   GenArmCdeBuiltinDef,
98   GenArmCdeBuiltinSema,
99   GenArmCdeBuiltinCG,
100   GenArmCdeBuiltinAliases,
101   GenRISCVVectorHeader,
102   GenRISCVVectorBuiltins,
103   GenRISCVVectorBuiltinCG,
104   GenRISCVVectorBuiltinSema,
105   GenRISCVSiFiveVectorBuiltins,
106   GenRISCVSiFiveVectorBuiltinCG,
107   GenRISCVSiFiveVectorBuiltinSema,
108   GenAttrDocs,
109   GenDiagDocs,
110   GenOptDocs,
111   GenDataCollectors,
112   GenTestPragmaAttributeSupportedAttributes
113 };
114 
115 namespace {
116 cl::opt<ActionType> Action(
117     cl::desc("Action to perform:"),
118     cl::values(
119         clEnumValN(PrintRecords, "print-records",
120                    "Print all records to stdout (default)"),
121         clEnumValN(DumpJSON, "dump-json",
122                    "Dump all records as machine-readable JSON"),
123         clEnumValN(GenClangAttrClasses, "gen-clang-attr-classes",
124                    "Generate clang attribute clases"),
125         clEnumValN(GenClangAttrParserStringSwitches,
126                    "gen-clang-attr-parser-string-switches",
127                    "Generate all parser-related attribute string switches"),
128         clEnumValN(GenClangAttrSubjectMatchRulesParserStringSwitches,
129                    "gen-clang-attr-subject-match-rules-parser-string-switches",
130                    "Generate all parser-related attribute subject match rule"
131                    "string switches"),
132         clEnumValN(GenClangAttrImpl, "gen-clang-attr-impl",
133                    "Generate clang attribute implementations"),
134         clEnumValN(GenClangAttrList, "gen-clang-attr-list",
135                    "Generate a clang attribute list"),
136         clEnumValN(GenClangAttrCanPrintLeftList,
137                    "gen-clang-attr-can-print-left-list",
138                    "Generate list of attributes that can be printed on left "
139                    "side of a decl"),
140         clEnumValN(GenClangAttrMustPrintLeftList,
141                    "gen-clang-attr-must-print-left-list",
142                    "Generate list of attributes that must be printed on left "
143                    "side of a decl"),
144         clEnumValN(GenClangAttrDocTable, "gen-clang-attr-doc-table",
145                    "Generate a table of attribute documentation"),
146         clEnumValN(GenClangAttrSubjectMatchRuleList,
147                    "gen-clang-attr-subject-match-rule-list",
148                    "Generate a clang attribute subject match rule list"),
149         clEnumValN(GenClangAttrPCHRead, "gen-clang-attr-pch-read",
150                    "Generate clang PCH attribute reader"),
151         clEnumValN(GenClangAttrPCHWrite, "gen-clang-attr-pch-write",
152                    "Generate clang PCH attribute writer"),
153         clEnumValN(GenClangAttrTokenKinds, "gen-clang-attr-token-kinds",
154                    "Generate a list of attribute-related clang tokens"),
155         clEnumValN(GenClangAttrHasAttributeImpl,
156                    "gen-clang-attr-has-attribute-impl",
157                    "Generate a clang attribute spelling list"),
158         clEnumValN(GenClangAttrSpellingListIndex,
159                    "gen-clang-attr-spelling-index",
160                    "Generate a clang attribute spelling index"),
161         clEnumValN(GenClangAttrASTVisitor, "gen-clang-attr-ast-visitor",
162                    "Generate a recursive AST visitor for clang attributes"),
163         clEnumValN(GenClangAttrTemplateInstantiate,
164                    "gen-clang-attr-template-instantiate",
165                    "Generate a clang template instantiate code"),
166         clEnumValN(GenClangAttrParsedAttrList,
167                    "gen-clang-attr-parsed-attr-list",
168                    "Generate a clang parsed attribute list"),
169         clEnumValN(GenClangAttrParsedAttrImpl,
170                    "gen-clang-attr-parsed-attr-impl",
171                    "Generate the clang parsed attribute helpers"),
172         clEnumValN(GenClangAttrParsedAttrKinds,
173                    "gen-clang-attr-parsed-attr-kinds",
174                    "Generate a clang parsed attribute kinds"),
175         clEnumValN(GenClangAttrTextNodeDump, "gen-clang-attr-text-node-dump",
176                    "Generate clang attribute text node dumper"),
177         clEnumValN(GenClangAttrNodeTraverse, "gen-clang-attr-node-traverse",
178                    "Generate clang attribute traverser"),
179         clEnumValN(GenClangDiagsDefs, "gen-clang-diags-defs",
180                    "Generate Clang diagnostics definitions"),
181         clEnumValN(GenClangDiagGroups, "gen-clang-diag-groups",
182                    "Generate Clang diagnostic groups"),
183         clEnumValN(GenClangDiagsIndexName, "gen-clang-diags-index-name",
184                    "Generate Clang diagnostic name index"),
185         clEnumValN(GenClangBasicReader, "gen-clang-basic-reader",
186                    "Generate Clang BasicReader classes"),
187         clEnumValN(GenClangBasicWriter, "gen-clang-basic-writer",
188                    "Generate Clang BasicWriter classes"),
189         clEnumValN(GenClangCommentNodes, "gen-clang-comment-nodes",
190                    "Generate Clang AST comment nodes"),
191         clEnumValN(GenClangDeclNodes, "gen-clang-decl-nodes",
192                    "Generate Clang AST declaration nodes"),
193         clEnumValN(GenClangStmtNodes, "gen-clang-stmt-nodes",
194                    "Generate Clang AST statement nodes"),
195         clEnumValN(GenClangTypeNodes, "gen-clang-type-nodes",
196                    "Generate Clang AST type nodes"),
197         clEnumValN(GenClangTypeReader, "gen-clang-type-reader",
198                    "Generate Clang AbstractTypeReader class"),
199         clEnumValN(GenClangTypeWriter, "gen-clang-type-writer",
200                    "Generate Clang AbstractTypeWriter class"),
201         clEnumValN(GenClangOpcodes, "gen-clang-opcodes",
202                    "Generate Clang constexpr interpreter opcodes"),
203         clEnumValN(GenClangSACheckers, "gen-clang-sa-checkers",
204                    "Generate Clang Static Analyzer checkers"),
205         clEnumValN(GenClangSyntaxNodeList, "gen-clang-syntax-node-list",
206                    "Generate list of Clang Syntax Tree node types"),
207         clEnumValN(GenClangSyntaxNodeClasses, "gen-clang-syntax-node-classes",
208                    "Generate definitions of Clang Syntax Tree node clasess"),
209         clEnumValN(GenClangCommentHTMLTags, "gen-clang-comment-html-tags",
210                    "Generate efficient matchers for HTML tag "
211                    "names that are used in documentation comments"),
212         clEnumValN(GenClangCommentHTMLTagsProperties,
213                    "gen-clang-comment-html-tags-properties",
214                    "Generate efficient matchers for HTML tag "
215                    "properties"),
216         clEnumValN(GenClangCommentHTMLNamedCharacterReferences,
217                    "gen-clang-comment-html-named-character-references",
218                    "Generate function to translate named character "
219                    "references to UTF-8 sequences"),
220         clEnumValN(GenClangCommentCommandInfo, "gen-clang-comment-command-info",
221                    "Generate command properties for commands that "
222                    "are used in documentation comments"),
223         clEnumValN(GenClangCommentCommandList, "gen-clang-comment-command-list",
224                    "Generate list of commands that are used in "
225                    "documentation comments"),
226         clEnumValN(GenClangOpenCLBuiltins, "gen-clang-opencl-builtins",
227                    "Generate OpenCL builtin declaration handlers"),
228         clEnumValN(GenClangOpenCLBuiltinHeader,
229                    "gen-clang-opencl-builtin-header",
230                    "Generate OpenCL builtin header"),
231         clEnumValN(GenClangOpenCLBuiltinTests, "gen-clang-opencl-builtin-tests",
232                    "Generate OpenCL builtin declaration tests"),
233         clEnumValN(GenArmNeon, "gen-arm-neon", "Generate arm_neon.h for clang"),
234         clEnumValN(GenArmFP16, "gen-arm-fp16", "Generate arm_fp16.h for clang"),
235         clEnumValN(GenArmBF16, "gen-arm-bf16", "Generate arm_bf16.h for clang"),
236         clEnumValN(GenArmVectorType, "gen-arm-vector-type",
237                    "Generate arm_vector_types.h for clang"),
238         clEnumValN(GenArmNeonSema, "gen-arm-neon-sema",
239                    "Generate ARM NEON sema support for clang"),
240         clEnumValN(GenArmNeonTest, "gen-arm-neon-test",
241                    "Generate ARM NEON tests for clang"),
242         clEnumValN(GenArmSveHeader, "gen-arm-sve-header",
243                    "Generate arm_sve.h for clang"),
244         clEnumValN(GenArmSveBuiltins, "gen-arm-sve-builtins",
245                    "Generate arm_sve_builtins.inc for clang"),
246         clEnumValN(GenArmSveBuiltinCG, "gen-arm-sve-builtin-codegen",
247                    "Generate arm_sve_builtin_cg_map.inc for clang"),
248         clEnumValN(GenArmSveTypeFlags, "gen-arm-sve-typeflags",
249                    "Generate arm_sve_typeflags.inc for clang"),
250         clEnumValN(GenArmSveRangeChecks, "gen-arm-sve-sema-rangechecks",
251                    "Generate arm_sve_sema_rangechecks.inc for clang"),
252         clEnumValN(GenArmSveStreamingAttrs, "gen-arm-sve-streaming-attrs",
253                    "Generate arm_sve_streaming_attrs.inc for clang"),
254         clEnumValN(GenArmSmeHeader, "gen-arm-sme-header",
255                    "Generate arm_sme.h for clang"),
256         clEnumValN(GenArmSmeBuiltins, "gen-arm-sme-builtins",
257                    "Generate arm_sme_builtins.inc for clang"),
258         clEnumValN(GenArmSmeBuiltinCG, "gen-arm-sme-builtin-codegen",
259                    "Generate arm_sme_builtin_cg_map.inc for clang"),
260         clEnumValN(GenArmSmeRangeChecks, "gen-arm-sme-sema-rangechecks",
261                    "Generate arm_sme_sema_rangechecks.inc for clang"),
262         clEnumValN(GenArmSmeStreamingAttrs, "gen-arm-sme-streaming-attrs",
263                    "Generate arm_sme_streaming_attrs.inc for clang"),
264         clEnumValN(GenArmSmeBuiltinZAState, "gen-arm-sme-builtin-za-state",
265                    "Generate arm_sme_builtins_za_state.inc for clang"),
266         clEnumValN(GenArmMveHeader, "gen-arm-mve-header",
267                    "Generate arm_mve.h for clang"),
268         clEnumValN(GenArmMveBuiltinDef, "gen-arm-mve-builtin-def",
269                    "Generate ARM MVE builtin definitions for clang"),
270         clEnumValN(GenArmMveBuiltinSema, "gen-arm-mve-builtin-sema",
271                    "Generate ARM MVE builtin sema checks for clang"),
272         clEnumValN(GenArmMveBuiltinCG, "gen-arm-mve-builtin-codegen",
273                    "Generate ARM MVE builtin code-generator for clang"),
274         clEnumValN(GenArmMveBuiltinAliases, "gen-arm-mve-builtin-aliases",
275                    "Generate list of valid ARM MVE builtin aliases for clang"),
276         clEnumValN(GenArmCdeHeader, "gen-arm-cde-header",
277                    "Generate arm_cde.h for clang"),
278         clEnumValN(GenArmCdeBuiltinDef, "gen-arm-cde-builtin-def",
279                    "Generate ARM CDE builtin definitions for clang"),
280         clEnumValN(GenArmCdeBuiltinSema, "gen-arm-cde-builtin-sema",
281                    "Generate ARM CDE builtin sema checks for clang"),
282         clEnumValN(GenArmCdeBuiltinCG, "gen-arm-cde-builtin-codegen",
283                    "Generate ARM CDE builtin code-generator for clang"),
284         clEnumValN(GenArmCdeBuiltinAliases, "gen-arm-cde-builtin-aliases",
285                    "Generate list of valid ARM CDE builtin aliases for clang"),
286         clEnumValN(GenRISCVVectorHeader, "gen-riscv-vector-header",
287                    "Generate riscv_vector.h for clang"),
288         clEnumValN(GenRISCVVectorBuiltins, "gen-riscv-vector-builtins",
289                    "Generate riscv_vector_builtins.inc for clang"),
290         clEnumValN(GenRISCVVectorBuiltinCG, "gen-riscv-vector-builtin-codegen",
291                    "Generate riscv_vector_builtin_cg.inc for clang"),
292         clEnumValN(GenRISCVVectorBuiltinSema, "gen-riscv-vector-builtin-sema",
293                    "Generate riscv_vector_builtin_sema.inc for clang"),
294         clEnumValN(GenRISCVSiFiveVectorBuiltins, "gen-riscv-sifive-vector-builtins",
295                    "Generate riscv_sifive_vector_builtins.inc for clang"),
296         clEnumValN(GenRISCVSiFiveVectorBuiltinCG, "gen-riscv-sifive-vector-builtin-codegen",
297                    "Generate riscv_sifive_vector_builtin_cg.inc for clang"),
298         clEnumValN(GenRISCVSiFiveVectorBuiltinSema, "gen-riscv-sifive-vector-builtin-sema",
299                    "Generate riscv_sifive_vector_builtin_sema.inc for clang"),
300         clEnumValN(GenAttrDocs, "gen-attr-docs",
301                    "Generate attribute documentation"),
302         clEnumValN(GenDiagDocs, "gen-diag-docs",
303                    "Generate diagnostic documentation"),
304         clEnumValN(GenOptDocs, "gen-opt-docs", "Generate option documentation"),
305         clEnumValN(GenDataCollectors, "gen-clang-data-collectors",
306                    "Generate data collectors for AST nodes"),
307         clEnumValN(GenTestPragmaAttributeSupportedAttributes,
308                    "gen-clang-test-pragma-attribute-supported-attributes",
309                    "Generate a list of attributes supported by #pragma clang "
310                    "attribute for testing purposes")));
311 
312 cl::opt<std::string>
313 ClangComponent("clang-component",
314                cl::desc("Only use warnings from specified component"),
315                cl::value_desc("component"), cl::Hidden);
316 
317 bool ClangTableGenMain(raw_ostream &OS, RecordKeeper &Records) {
318   switch (Action) {
319   case PrintRecords:
320     OS << Records;           // No argument, dump all contents
321     break;
322   case DumpJSON:
323     EmitJSON(Records, OS);
324     break;
325   case GenClangAttrClasses:
326     EmitClangAttrClass(Records, OS);
327     break;
328   case GenClangAttrParserStringSwitches:
329     EmitClangAttrParserStringSwitches(Records, OS);
330     break;
331   case GenClangAttrSubjectMatchRulesParserStringSwitches:
332     EmitClangAttrSubjectMatchRulesParserStringSwitches(Records, OS);
333     break;
334   case GenClangAttrImpl:
335     EmitClangAttrImpl(Records, OS);
336     break;
337   case GenClangAttrList:
338     EmitClangAttrList(Records, OS);
339     break;
340   case GenClangAttrCanPrintLeftList:
341     EmitClangAttrPrintList("CanPrintOnLeft", Records, OS);
342     break;
343   case GenClangAttrMustPrintLeftList:
344     EmitClangAttrPrintList("PrintOnLeft", Records, OS);
345     break;
346   case GenClangAttrDocTable:
347     EmitClangAttrDocTable(Records, OS);
348     break;
349   case GenClangAttrSubjectMatchRuleList:
350     EmitClangAttrSubjectMatchRuleList(Records, OS);
351     break;
352   case GenClangAttrPCHRead:
353     EmitClangAttrPCHRead(Records, OS);
354     break;
355   case GenClangAttrPCHWrite:
356     EmitClangAttrPCHWrite(Records, OS);
357     break;
358   case GenClangAttrTokenKinds:
359     EmitClangAttrTokenKinds(Records, OS);
360     break;
361   case GenClangAttrHasAttributeImpl:
362     EmitClangAttrHasAttrImpl(Records, OS);
363     break;
364   case GenClangAttrSpellingListIndex:
365     EmitClangAttrSpellingListIndex(Records, OS);
366     break;
367   case GenClangAttrASTVisitor:
368     EmitClangAttrASTVisitor(Records, OS);
369     break;
370   case GenClangAttrTemplateInstantiate:
371     EmitClangAttrTemplateInstantiate(Records, OS);
372     break;
373   case GenClangAttrParsedAttrList:
374     EmitClangAttrParsedAttrList(Records, OS);
375     break;
376   case GenClangAttrParsedAttrImpl:
377     EmitClangAttrParsedAttrImpl(Records, OS);
378     break;
379   case GenClangAttrParsedAttrKinds:
380     EmitClangAttrParsedAttrKinds(Records, OS);
381     break;
382   case GenClangAttrTextNodeDump:
383     EmitClangAttrTextNodeDump(Records, OS);
384     break;
385   case GenClangAttrNodeTraverse:
386     EmitClangAttrNodeTraverse(Records, OS);
387     break;
388   case GenClangDiagsDefs:
389     EmitClangDiagsDefs(Records, OS, ClangComponent);
390     break;
391   case GenClangDiagGroups:
392     EmitClangDiagGroups(Records, OS);
393     break;
394   case GenClangDiagsIndexName:
395     EmitClangDiagsIndexName(Records, OS);
396     break;
397   case GenClangCommentNodes:
398     EmitClangASTNodes(Records, OS, CommentNodeClassName, "");
399     break;
400   case GenClangDeclNodes:
401     EmitClangASTNodes(Records, OS, DeclNodeClassName, "Decl",
402                       DeclContextNodeClassName);
403     EmitClangDeclContext(Records, OS);
404     break;
405   case GenClangStmtNodes:
406     EmitClangASTNodes(Records, OS, StmtNodeClassName, "");
407     break;
408   case GenClangTypeNodes:
409     EmitClangTypeNodes(Records, OS);
410     break;
411   case GenClangTypeReader:
412     EmitClangTypeReader(Records, OS);
413     break;
414   case GenClangTypeWriter:
415     EmitClangTypeWriter(Records, OS);
416     break;
417   case GenClangBasicReader:
418     EmitClangBasicReader(Records, OS);
419     break;
420   case GenClangBasicWriter:
421     EmitClangBasicWriter(Records, OS);
422     break;
423   case GenClangOpcodes:
424     EmitClangOpcodes(Records, OS);
425     break;
426   case GenClangSACheckers:
427     EmitClangSACheckers(Records, OS);
428     break;
429   case GenClangCommentHTMLTags:
430     EmitClangCommentHTMLTags(Records, OS);
431     break;
432   case GenClangCommentHTMLTagsProperties:
433     EmitClangCommentHTMLTagsProperties(Records, OS);
434     break;
435   case GenClangCommentHTMLNamedCharacterReferences:
436     EmitClangCommentHTMLNamedCharacterReferences(Records, OS);
437     break;
438   case GenClangCommentCommandInfo:
439     EmitClangCommentCommandInfo(Records, OS);
440     break;
441   case GenClangCommentCommandList:
442     EmitClangCommentCommandList(Records, OS);
443     break;
444   case GenClangOpenCLBuiltins:
445     EmitClangOpenCLBuiltins(Records, OS);
446     break;
447   case GenClangOpenCLBuiltinHeader:
448     EmitClangOpenCLBuiltinHeader(Records, OS);
449     break;
450   case GenClangOpenCLBuiltinTests:
451     EmitClangOpenCLBuiltinTests(Records, OS);
452     break;
453   case GenClangSyntaxNodeList:
454     EmitClangSyntaxNodeList(Records, OS);
455     break;
456   case GenClangSyntaxNodeClasses:
457     EmitClangSyntaxNodeClasses(Records, OS);
458     break;
459   case GenArmNeon:
460     EmitNeon(Records, OS);
461     break;
462   case GenArmFP16:
463     EmitFP16(Records, OS);
464     break;
465   case GenArmVectorType:
466     EmitVectorTypes(Records, OS);
467     break;
468   case GenArmBF16:
469     EmitBF16(Records, OS);
470     break;
471   case GenArmNeonSema:
472     EmitNeonSema(Records, OS);
473     break;
474   case GenArmNeonTest:
475     EmitNeonTest(Records, OS);
476     break;
477   case GenArmMveHeader:
478     EmitMveHeader(Records, OS);
479     break;
480   case GenArmMveBuiltinDef:
481     EmitMveBuiltinDef(Records, OS);
482     break;
483   case GenArmMveBuiltinSema:
484     EmitMveBuiltinSema(Records, OS);
485     break;
486   case GenArmMveBuiltinCG:
487     EmitMveBuiltinCG(Records, OS);
488     break;
489   case GenArmMveBuiltinAliases:
490     EmitMveBuiltinAliases(Records, OS);
491     break;
492   case GenArmSveHeader:
493     EmitSveHeader(Records, OS);
494     break;
495   case GenArmSveBuiltins:
496     EmitSveBuiltins(Records, OS);
497     break;
498   case GenArmSveBuiltinCG:
499     EmitSveBuiltinCG(Records, OS);
500     break;
501   case GenArmSveTypeFlags:
502     EmitSveTypeFlags(Records, OS);
503     break;
504   case GenArmSveRangeChecks:
505     EmitSveRangeChecks(Records, OS);
506     break;
507   case GenArmSveStreamingAttrs:
508     EmitSveStreamingAttrs(Records, OS);
509     break;
510   case GenArmSmeHeader:
511     EmitSmeHeader(Records, OS);
512     break;
513   case GenArmSmeBuiltins:
514     EmitSmeBuiltins(Records, OS);
515     break;
516   case GenArmSmeBuiltinCG:
517     EmitSmeBuiltinCG(Records, OS);
518     break;
519   case GenArmSmeRangeChecks:
520     EmitSmeRangeChecks(Records, OS);
521     break;
522   case GenArmSmeStreamingAttrs:
523     EmitSmeStreamingAttrs(Records, OS);
524     break;
525   case GenArmSmeBuiltinZAState:
526     EmitSmeBuiltinZAState(Records, OS);
527     break;
528   case GenArmCdeHeader:
529     EmitCdeHeader(Records, OS);
530     break;
531   case GenArmCdeBuiltinDef:
532     EmitCdeBuiltinDef(Records, OS);
533     break;
534   case GenArmCdeBuiltinSema:
535     EmitCdeBuiltinSema(Records, OS);
536     break;
537   case GenArmCdeBuiltinCG:
538     EmitCdeBuiltinCG(Records, OS);
539     break;
540   case GenArmCdeBuiltinAliases:
541     EmitCdeBuiltinAliases(Records, OS);
542     break;
543   case GenRISCVVectorHeader:
544     EmitRVVHeader(Records, OS);
545     break;
546   case GenRISCVVectorBuiltins:
547     EmitRVVBuiltins(Records, OS);
548     break;
549   case GenRISCVVectorBuiltinCG:
550     EmitRVVBuiltinCG(Records, OS);
551     break;
552   case GenRISCVVectorBuiltinSema:
553     EmitRVVBuiltinSema(Records, OS);
554     break;
555   case GenRISCVSiFiveVectorBuiltins:
556     EmitRVVBuiltins(Records, OS);
557     break;
558   case GenRISCVSiFiveVectorBuiltinCG:
559     EmitRVVBuiltinCG(Records, OS);
560     break;
561   case GenRISCVSiFiveVectorBuiltinSema:
562     EmitRVVBuiltinSema(Records, OS);
563     break;
564   case GenAttrDocs:
565     EmitClangAttrDocs(Records, OS);
566     break;
567   case GenDiagDocs:
568     EmitClangDiagDocs(Records, OS);
569     break;
570   case GenOptDocs:
571     EmitClangOptDocs(Records, OS);
572     break;
573   case GenDataCollectors:
574     EmitClangDataCollectors(Records, OS);
575     break;
576   case GenTestPragmaAttributeSupportedAttributes:
577     EmitTestPragmaAttributeSupportedAttributes(Records, OS);
578     break;
579   }
580 
581   return false;
582 }
583 }
584 
585 int main(int argc, char **argv) {
586   sys::PrintStackTraceOnErrorSignal(argv[0]);
587   PrettyStackTraceProgram X(argc, argv);
588   cl::ParseCommandLineOptions(argc, argv);
589 
590   llvm_shutdown_obj Y;
591 
592   return TableGenMain(argv[0], &ClangTableGenMain);
593 }
594 
595 #ifdef __has_feature
596 #if __has_feature(address_sanitizer)
597 #include <sanitizer/lsan_interface.h>
598 // Disable LeakSanitizer for this binary as it has too many leaks that are not
599 // very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
600 int __lsan_is_turned_off() { return 1; }
601 #endif  // __has_feature(address_sanitizer)
602 #endif  // defined(__has_feature)
603