[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / utils / TableGen / TableGen.cpp
blobc1f2ca15b595c0cc32b7e9628efc7717d19431db
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 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
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")));
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);
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 EmitClangDeclContext(Records, OS);
403 break;
404 case GenClangStmtNodes:
405 EmitClangASTNodes(Records, OS, StmtNodeClassName, "");
406 break;
407 case GenClangTypeNodes:
408 EmitClangTypeNodes(Records, OS);
409 break;
410 case GenClangTypeReader:
411 EmitClangTypeReader(Records, OS);
412 break;
413 case GenClangTypeWriter:
414 EmitClangTypeWriter(Records, OS);
415 break;
416 case GenClangBasicReader:
417 EmitClangBasicReader(Records, OS);
418 break;
419 case GenClangBasicWriter:
420 EmitClangBasicWriter(Records, OS);
421 break;
422 case GenClangOpcodes:
423 EmitClangOpcodes(Records, OS);
424 break;
425 case GenClangSACheckers:
426 EmitClangSACheckers(Records, OS);
427 break;
428 case GenClangCommentHTMLTags:
429 EmitClangCommentHTMLTags(Records, OS);
430 break;
431 case GenClangCommentHTMLTagsProperties:
432 EmitClangCommentHTMLTagsProperties(Records, OS);
433 break;
434 case GenClangCommentHTMLNamedCharacterReferences:
435 EmitClangCommentHTMLNamedCharacterReferences(Records, OS);
436 break;
437 case GenClangCommentCommandInfo:
438 EmitClangCommentCommandInfo(Records, OS);
439 break;
440 case GenClangCommentCommandList:
441 EmitClangCommentCommandList(Records, OS);
442 break;
443 case GenClangOpenCLBuiltins:
444 EmitClangOpenCLBuiltins(Records, OS);
445 break;
446 case GenClangOpenCLBuiltinHeader:
447 EmitClangOpenCLBuiltinHeader(Records, OS);
448 break;
449 case GenClangOpenCLBuiltinTests:
450 EmitClangOpenCLBuiltinTests(Records, OS);
451 break;
452 case GenClangSyntaxNodeList:
453 EmitClangSyntaxNodeList(Records, OS);
454 break;
455 case GenClangSyntaxNodeClasses:
456 EmitClangSyntaxNodeClasses(Records, OS);
457 break;
458 case GenArmNeon:
459 EmitNeon(Records, OS);
460 break;
461 case GenArmFP16:
462 EmitFP16(Records, OS);
463 break;
464 case GenArmVectorType:
465 EmitVectorTypes(Records, OS);
466 break;
467 case GenArmBF16:
468 EmitBF16(Records, OS);
469 break;
470 case GenArmNeonSema:
471 EmitNeonSema(Records, OS);
472 break;
473 case GenArmNeonTest:
474 EmitNeonTest(Records, OS);
475 break;
476 case GenArmMveHeader:
477 EmitMveHeader(Records, OS);
478 break;
479 case GenArmMveBuiltinDef:
480 EmitMveBuiltinDef(Records, OS);
481 break;
482 case GenArmMveBuiltinSema:
483 EmitMveBuiltinSema(Records, OS);
484 break;
485 case GenArmMveBuiltinCG:
486 EmitMveBuiltinCG(Records, OS);
487 break;
488 case GenArmMveBuiltinAliases:
489 EmitMveBuiltinAliases(Records, OS);
490 break;
491 case GenArmSveHeader:
492 EmitSveHeader(Records, OS);
493 break;
494 case GenArmSveBuiltins:
495 EmitSveBuiltins(Records, OS);
496 break;
497 case GenArmSveBuiltinCG:
498 EmitSveBuiltinCG(Records, OS);
499 break;
500 case GenArmSveTypeFlags:
501 EmitSveTypeFlags(Records, OS);
502 break;
503 case GenArmSveRangeChecks:
504 EmitSveRangeChecks(Records, OS);
505 break;
506 case GenArmSveStreamingAttrs:
507 EmitSveStreamingAttrs(Records, OS);
508 break;
509 case GenArmSmeHeader:
510 EmitSmeHeader(Records, OS);
511 break;
512 case GenArmSmeBuiltins:
513 EmitSmeBuiltins(Records, OS);
514 break;
515 case GenArmSmeBuiltinCG:
516 EmitSmeBuiltinCG(Records, OS);
517 break;
518 case GenArmSmeRangeChecks:
519 EmitSmeRangeChecks(Records, OS);
520 break;
521 case GenArmSmeStreamingAttrs:
522 EmitSmeStreamingAttrs(Records, OS);
523 break;
524 case GenArmSmeBuiltinZAState:
525 EmitSmeBuiltinZAState(Records, OS);
526 break;
527 case GenArmCdeHeader:
528 EmitCdeHeader(Records, OS);
529 break;
530 case GenArmCdeBuiltinDef:
531 EmitCdeBuiltinDef(Records, OS);
532 break;
533 case GenArmCdeBuiltinSema:
534 EmitCdeBuiltinSema(Records, OS);
535 break;
536 case GenArmCdeBuiltinCG:
537 EmitCdeBuiltinCG(Records, OS);
538 break;
539 case GenArmCdeBuiltinAliases:
540 EmitCdeBuiltinAliases(Records, OS);
541 break;
542 case GenRISCVVectorHeader:
543 EmitRVVHeader(Records, OS);
544 break;
545 case GenRISCVVectorBuiltins:
546 EmitRVVBuiltins(Records, OS);
547 break;
548 case GenRISCVVectorBuiltinCG:
549 EmitRVVBuiltinCG(Records, OS);
550 break;
551 case GenRISCVVectorBuiltinSema:
552 EmitRVVBuiltinSema(Records, OS);
553 break;
554 case GenRISCVSiFiveVectorBuiltins:
555 EmitRVVBuiltins(Records, OS);
556 break;
557 case GenRISCVSiFiveVectorBuiltinCG:
558 EmitRVVBuiltinCG(Records, OS);
559 break;
560 case GenRISCVSiFiveVectorBuiltinSema:
561 EmitRVVBuiltinSema(Records, OS);
562 break;
563 case GenAttrDocs:
564 EmitClangAttrDocs(Records, OS);
565 break;
566 case GenDiagDocs:
567 EmitClangDiagDocs(Records, OS);
568 break;
569 case GenOptDocs:
570 EmitClangOptDocs(Records, OS);
571 break;
572 case GenDataCollectors:
573 EmitClangDataCollectors(Records, OS);
574 break;
575 case GenTestPragmaAttributeSupportedAttributes:
576 EmitTestPragmaAttributeSupportedAttributes(Records, OS);
577 break;
580 return false;
584 int main(int argc, char **argv) {
585 sys::PrintStackTraceOnErrorSignal(argv[0]);
586 PrettyStackTraceProgram X(argc, argv);
587 cl::ParseCommandLineOptions(argc, argv);
589 llvm_shutdown_obj Y;
591 return TableGenMain(argv[0], &ClangTableGenMain);
594 #ifdef __has_feature
595 #if __has_feature(address_sanitizer)
596 #include <sanitizer/lsan_interface.h>
597 // Disable LeakSanitizer for this binary as it has too many leaks that are not
598 // very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
599 int __lsan_is_turned_off() { return 1; }
600 #endif // __has_feature(address_sanitizer)
601 #endif // defined(__has_feature)