1 //===- TableGen.cpp - Top-Level TableGen implementation for Clang ---------===//
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
7 //===----------------------------------------------------------------------===//
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"
24 using namespace clang
;
30 GenClangAttrParserStringSwitches
,
31 GenClangAttrSubjectMatchRulesParserStringSwitches
,
34 GenClangAttrCanPrintLeftList
,
35 GenClangAttrMustPrintLeftList
,
37 GenClangAttrSubjectMatchRuleList
,
40 GenClangAttrTokenKinds
,
41 GenClangAttrHasAttributeImpl
,
42 GenClangAttrSpellingListIndex
,
43 GenClangAttrASTVisitor
,
44 GenClangAttrTemplateInstantiate
,
45 GenClangAttrParsedAttrList
,
46 GenClangAttrParsedAttrImpl
,
47 GenClangAttrParsedAttrKinds
,
48 GenClangAttrTextNodeDump
,
49 GenClangAttrNodeTraverse
,
54 GenClangDiagsIndexName
,
63 GenClangSyntaxNodeList
,
64 GenClangSyntaxNodeClasses
,
65 GenClangCommentHTMLTags
,
66 GenClangCommentHTMLTagsProperties
,
67 GenClangCommentHTMLNamedCharacterReferences
,
68 GenClangCommentCommandInfo
,
69 GenClangCommentCommandList
,
70 GenClangOpenCLBuiltins
,
71 GenClangOpenCLBuiltinHeader
,
72 GenClangOpenCLBuiltinTests
,
83 GenArmMveBuiltinAliases
,
89 GenArmSveStreamingAttrs
,
94 GenArmSmeStreamingAttrs
,
95 GenArmSmeBuiltinZAState
,
100 GenArmCdeBuiltinAliases
,
101 GenRISCVVectorHeader
,
102 GenRISCVVectorBuiltins
,
103 GenRISCVVectorBuiltinCG
,
104 GenRISCVVectorBuiltinSema
,
105 GenRISCVSiFiveVectorBuiltins
,
106 GenRISCVSiFiveVectorBuiltinCG
,
107 GenRISCVSiFiveVectorBuiltinSema
,
112 GenTestPragmaAttributeSupportedAttributes
116 cl::opt
<ActionType
> Action(
117 cl::desc("Action to perform:"),
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"
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 "
140 clEnumValN(GenClangAttrMustPrintLeftList
,
141 "gen-clang-attr-must-print-left-list",
142 "Generate list of attributes that must be printed on left "
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 "
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")));
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
) {
320 OS
<< Records
; // No argument, dump all contents
323 EmitJSON(Records
, OS
);
325 case GenClangAttrClasses
:
326 EmitClangAttrClass(Records
, OS
);
328 case GenClangAttrParserStringSwitches
:
329 EmitClangAttrParserStringSwitches(Records
, OS
);
331 case GenClangAttrSubjectMatchRulesParserStringSwitches
:
332 EmitClangAttrSubjectMatchRulesParserStringSwitches(Records
, OS
);
334 case GenClangAttrImpl
:
335 EmitClangAttrImpl(Records
, OS
);
337 case GenClangAttrList
:
338 EmitClangAttrList(Records
, OS
);
340 case GenClangAttrCanPrintLeftList
:
341 EmitClangAttrPrintList("CanPrintOnLeft", Records
, OS
);
343 case GenClangAttrMustPrintLeftList
:
344 EmitClangAttrPrintList("PrintOnLeft", Records
, OS
);
346 case GenClangAttrDocTable
:
347 EmitClangAttrDocTable(Records
, OS
);
349 case GenClangAttrSubjectMatchRuleList
:
350 EmitClangAttrSubjectMatchRuleList(Records
, OS
);
352 case GenClangAttrPCHRead
:
353 EmitClangAttrPCHRead(Records
, OS
);
355 case GenClangAttrPCHWrite
:
356 EmitClangAttrPCHWrite(Records
, OS
);
358 case GenClangAttrTokenKinds
:
359 EmitClangAttrTokenKinds(Records
, OS
);
361 case GenClangAttrHasAttributeImpl
:
362 EmitClangAttrHasAttrImpl(Records
, OS
);
364 case GenClangAttrSpellingListIndex
:
365 EmitClangAttrSpellingListIndex(Records
, OS
);
367 case GenClangAttrASTVisitor
:
368 EmitClangAttrASTVisitor(Records
, OS
);
370 case GenClangAttrTemplateInstantiate
:
371 EmitClangAttrTemplateInstantiate(Records
, OS
);
373 case GenClangAttrParsedAttrList
:
374 EmitClangAttrParsedAttrList(Records
, OS
);
376 case GenClangAttrParsedAttrImpl
:
377 EmitClangAttrParsedAttrImpl(Records
, OS
);
379 case GenClangAttrParsedAttrKinds
:
380 EmitClangAttrParsedAttrKinds(Records
, OS
);
382 case GenClangAttrTextNodeDump
:
383 EmitClangAttrTextNodeDump(Records
, OS
);
385 case GenClangAttrNodeTraverse
:
386 EmitClangAttrNodeTraverse(Records
, OS
);
388 case GenClangDiagsDefs
:
389 EmitClangDiagsDefs(Records
, OS
, ClangComponent
);
391 case GenClangDiagGroups
:
392 EmitClangDiagGroups(Records
, OS
);
394 case GenClangDiagsIndexName
:
395 EmitClangDiagsIndexName(Records
, OS
);
397 case GenClangCommentNodes
:
398 EmitClangASTNodes(Records
, OS
, CommentNodeClassName
, "");
400 case GenClangDeclNodes
:
401 EmitClangASTNodes(Records
, OS
, DeclNodeClassName
, "Decl");
402 EmitClangDeclContext(Records
, OS
);
404 case GenClangStmtNodes
:
405 EmitClangASTNodes(Records
, OS
, StmtNodeClassName
, "");
407 case GenClangTypeNodes
:
408 EmitClangTypeNodes(Records
, OS
);
410 case GenClangTypeReader
:
411 EmitClangTypeReader(Records
, OS
);
413 case GenClangTypeWriter
:
414 EmitClangTypeWriter(Records
, OS
);
416 case GenClangBasicReader
:
417 EmitClangBasicReader(Records
, OS
);
419 case GenClangBasicWriter
:
420 EmitClangBasicWriter(Records
, OS
);
422 case GenClangOpcodes
:
423 EmitClangOpcodes(Records
, OS
);
425 case GenClangSACheckers
:
426 EmitClangSACheckers(Records
, OS
);
428 case GenClangCommentHTMLTags
:
429 EmitClangCommentHTMLTags(Records
, OS
);
431 case GenClangCommentHTMLTagsProperties
:
432 EmitClangCommentHTMLTagsProperties(Records
, OS
);
434 case GenClangCommentHTMLNamedCharacterReferences
:
435 EmitClangCommentHTMLNamedCharacterReferences(Records
, OS
);
437 case GenClangCommentCommandInfo
:
438 EmitClangCommentCommandInfo(Records
, OS
);
440 case GenClangCommentCommandList
:
441 EmitClangCommentCommandList(Records
, OS
);
443 case GenClangOpenCLBuiltins
:
444 EmitClangOpenCLBuiltins(Records
, OS
);
446 case GenClangOpenCLBuiltinHeader
:
447 EmitClangOpenCLBuiltinHeader(Records
, OS
);
449 case GenClangOpenCLBuiltinTests
:
450 EmitClangOpenCLBuiltinTests(Records
, OS
);
452 case GenClangSyntaxNodeList
:
453 EmitClangSyntaxNodeList(Records
, OS
);
455 case GenClangSyntaxNodeClasses
:
456 EmitClangSyntaxNodeClasses(Records
, OS
);
459 EmitNeon(Records
, OS
);
462 EmitFP16(Records
, OS
);
464 case GenArmVectorType
:
465 EmitVectorTypes(Records
, OS
);
468 EmitBF16(Records
, OS
);
471 EmitNeonSema(Records
, OS
);
474 EmitNeonTest(Records
, OS
);
476 case GenArmMveHeader
:
477 EmitMveHeader(Records
, OS
);
479 case GenArmMveBuiltinDef
:
480 EmitMveBuiltinDef(Records
, OS
);
482 case GenArmMveBuiltinSema
:
483 EmitMveBuiltinSema(Records
, OS
);
485 case GenArmMveBuiltinCG
:
486 EmitMveBuiltinCG(Records
, OS
);
488 case GenArmMveBuiltinAliases
:
489 EmitMveBuiltinAliases(Records
, OS
);
491 case GenArmSveHeader
:
492 EmitSveHeader(Records
, OS
);
494 case GenArmSveBuiltins
:
495 EmitSveBuiltins(Records
, OS
);
497 case GenArmSveBuiltinCG
:
498 EmitSveBuiltinCG(Records
, OS
);
500 case GenArmSveTypeFlags
:
501 EmitSveTypeFlags(Records
, OS
);
503 case GenArmSveRangeChecks
:
504 EmitSveRangeChecks(Records
, OS
);
506 case GenArmSveStreamingAttrs
:
507 EmitSveStreamingAttrs(Records
, OS
);
509 case GenArmSmeHeader
:
510 EmitSmeHeader(Records
, OS
);
512 case GenArmSmeBuiltins
:
513 EmitSmeBuiltins(Records
, OS
);
515 case GenArmSmeBuiltinCG
:
516 EmitSmeBuiltinCG(Records
, OS
);
518 case GenArmSmeRangeChecks
:
519 EmitSmeRangeChecks(Records
, OS
);
521 case GenArmSmeStreamingAttrs
:
522 EmitSmeStreamingAttrs(Records
, OS
);
524 case GenArmSmeBuiltinZAState
:
525 EmitSmeBuiltinZAState(Records
, OS
);
527 case GenArmCdeHeader
:
528 EmitCdeHeader(Records
, OS
);
530 case GenArmCdeBuiltinDef
:
531 EmitCdeBuiltinDef(Records
, OS
);
533 case GenArmCdeBuiltinSema
:
534 EmitCdeBuiltinSema(Records
, OS
);
536 case GenArmCdeBuiltinCG
:
537 EmitCdeBuiltinCG(Records
, OS
);
539 case GenArmCdeBuiltinAliases
:
540 EmitCdeBuiltinAliases(Records
, OS
);
542 case GenRISCVVectorHeader
:
543 EmitRVVHeader(Records
, OS
);
545 case GenRISCVVectorBuiltins
:
546 EmitRVVBuiltins(Records
, OS
);
548 case GenRISCVVectorBuiltinCG
:
549 EmitRVVBuiltinCG(Records
, OS
);
551 case GenRISCVVectorBuiltinSema
:
552 EmitRVVBuiltinSema(Records
, OS
);
554 case GenRISCVSiFiveVectorBuiltins
:
555 EmitRVVBuiltins(Records
, OS
);
557 case GenRISCVSiFiveVectorBuiltinCG
:
558 EmitRVVBuiltinCG(Records
, OS
);
560 case GenRISCVSiFiveVectorBuiltinSema
:
561 EmitRVVBuiltinSema(Records
, OS
);
564 EmitClangAttrDocs(Records
, OS
);
567 EmitClangDiagDocs(Records
, OS
);
570 EmitClangOptDocs(Records
, OS
);
572 case GenDataCollectors
:
573 EmitClangDataCollectors(Records
, OS
);
575 case GenTestPragmaAttributeSupportedAttributes
:
576 EmitTestPragmaAttributeSupportedAttributes(Records
, OS
);
584 int main(int argc
, char **argv
) {
585 sys::PrintStackTraceOnErrorSignal(argv
[0]);
586 PrettyStackTraceProgram
X(argc
, argv
);
587 cl::ParseCommandLineOptions(argc
, argv
);
591 return TableGenMain(argv
[0], &ClangTableGenMain
);
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)