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