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 "ASTTableGen.h"
14 #include "TableGenBackends.h" // Declares all backends.
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/Main.h"
20 #include "llvm/TableGen/Record.h"
23 using namespace clang
;
29 GenClangAttrParserStringSwitches
,
30 GenClangAttrSubjectMatchRulesParserStringSwitches
,
34 GenClangAttrSubjectMatchRuleList
,
37 GenClangRegularKeywordAttributeInfo
,
38 GenClangAttrHasAttributeImpl
,
39 GenClangAttrSpellingListIndex
,
40 GenClangAttrASTVisitor
,
41 GenClangAttrTemplateInstantiate
,
42 GenClangAttrParsedAttrList
,
43 GenClangAttrParsedAttrImpl
,
44 GenClangAttrParsedAttrKinds
,
45 GenClangAttrTextNodeDump
,
46 GenClangAttrNodeTraverse
,
52 GenClangDiagsIndexName
,
61 GenClangSyntaxNodeList
,
62 GenClangSyntaxNodeClasses
,
63 GenClangCommentHTMLTags
,
64 GenClangCommentHTMLTagsProperties
,
65 GenClangCommentHTMLNamedCharacterReferences
,
66 GenClangCommentCommandInfo
,
67 GenClangCommentCommandList
,
68 GenClangOpenCLBuiltins
,
69 GenClangOpenCLBuiltinHeader
,
70 GenClangOpenCLBuiltinTests
,
82 GenArmMveBuiltinAliases
,
88 GenArmSveStreamingAttrs
,
93 GenArmSmeStreamingAttrs
,
94 GenArmSmeBuiltinZAState
,
99 GenArmCdeBuiltinAliases
,
100 GenRISCVVectorHeader
,
101 GenRISCVVectorBuiltins
,
102 GenRISCVVectorBuiltinCG
,
103 GenRISCVVectorBuiltinSema
,
104 GenRISCVSiFiveVectorBuiltins
,
105 GenRISCVSiFiveVectorBuiltinCG
,
106 GenRISCVSiFiveVectorBuiltinSema
,
111 GenTestPragmaAttributeSupportedAttributes
115 cl::opt
<ActionType
> Action(
116 cl::desc("Action to perform:"),
118 clEnumValN(PrintRecords
, "print-records",
119 "Print all records to stdout (default)"),
120 clEnumValN(DumpJSON
, "dump-json",
121 "Dump all records as machine-readable JSON"),
122 clEnumValN(GenClangAttrClasses
, "gen-clang-attr-classes",
123 "Generate clang attribute clases"),
124 clEnumValN(GenClangAttrParserStringSwitches
,
125 "gen-clang-attr-parser-string-switches",
126 "Generate all parser-related attribute string switches"),
127 clEnumValN(GenClangAttrSubjectMatchRulesParserStringSwitches
,
128 "gen-clang-attr-subject-match-rules-parser-string-switches",
129 "Generate all parser-related attribute subject match rule"
131 clEnumValN(GenClangAttrImpl
, "gen-clang-attr-impl",
132 "Generate clang attribute implementations"),
133 clEnumValN(GenClangAttrList
, "gen-clang-attr-list",
134 "Generate a clang attribute list"),
135 clEnumValN(GenClangAttrDocTable
, "gen-clang-attr-doc-table",
136 "Generate a table of attribute documentation"),
137 clEnumValN(GenClangAttrSubjectMatchRuleList
,
138 "gen-clang-attr-subject-match-rule-list",
139 "Generate a clang attribute subject match rule list"),
140 clEnumValN(GenClangAttrPCHRead
, "gen-clang-attr-pch-read",
141 "Generate clang PCH attribute reader"),
142 clEnumValN(GenClangAttrPCHWrite
, "gen-clang-attr-pch-write",
143 "Generate clang PCH attribute writer"),
144 clEnumValN(GenClangRegularKeywordAttributeInfo
,
145 "gen-clang-regular-keyword-attr-info",
146 "Generate a list of regular keyword attributes with info "
147 "about their arguments"),
148 clEnumValN(GenClangAttrHasAttributeImpl
,
149 "gen-clang-attr-has-attribute-impl",
150 "Generate a clang attribute spelling list"),
151 clEnumValN(GenClangAttrSpellingListIndex
,
152 "gen-clang-attr-spelling-index",
153 "Generate a clang attribute spelling index"),
154 clEnumValN(GenClangAttrASTVisitor
, "gen-clang-attr-ast-visitor",
155 "Generate a recursive AST visitor for clang attributes"),
156 clEnumValN(GenClangAttrTemplateInstantiate
,
157 "gen-clang-attr-template-instantiate",
158 "Generate a clang template instantiate code"),
159 clEnumValN(GenClangAttrParsedAttrList
,
160 "gen-clang-attr-parsed-attr-list",
161 "Generate a clang parsed attribute list"),
162 clEnumValN(GenClangAttrParsedAttrImpl
,
163 "gen-clang-attr-parsed-attr-impl",
164 "Generate the clang parsed attribute helpers"),
165 clEnumValN(GenClangAttrParsedAttrKinds
,
166 "gen-clang-attr-parsed-attr-kinds",
167 "Generate a clang parsed attribute kinds"),
168 clEnumValN(GenClangAttrTextNodeDump
, "gen-clang-attr-text-node-dump",
169 "Generate clang attribute text node dumper"),
170 clEnumValN(GenClangAttrNodeTraverse
, "gen-clang-attr-node-traverse",
171 "Generate clang attribute traverser"),
172 clEnumValN(GenClangBuiltins
, "gen-clang-builtins",
173 "Generate clang builtins list"),
174 clEnumValN(GenClangDiagsDefs
, "gen-clang-diags-defs",
175 "Generate Clang diagnostics definitions"),
176 clEnumValN(GenClangDiagGroups
, "gen-clang-diag-groups",
177 "Generate Clang diagnostic groups"),
178 clEnumValN(GenClangDiagsIndexName
, "gen-clang-diags-index-name",
179 "Generate Clang diagnostic name index"),
180 clEnumValN(GenClangBasicReader
, "gen-clang-basic-reader",
181 "Generate Clang BasicReader classes"),
182 clEnumValN(GenClangBasicWriter
, "gen-clang-basic-writer",
183 "Generate Clang BasicWriter classes"),
184 clEnumValN(GenClangCommentNodes
, "gen-clang-comment-nodes",
185 "Generate Clang AST comment nodes"),
186 clEnumValN(GenClangDeclNodes
, "gen-clang-decl-nodes",
187 "Generate Clang AST declaration nodes"),
188 clEnumValN(GenClangStmtNodes
, "gen-clang-stmt-nodes",
189 "Generate Clang AST statement nodes"),
190 clEnumValN(GenClangTypeNodes
, "gen-clang-type-nodes",
191 "Generate Clang AST type nodes"),
192 clEnumValN(GenClangTypeReader
, "gen-clang-type-reader",
193 "Generate Clang AbstractTypeReader class"),
194 clEnumValN(GenClangTypeWriter
, "gen-clang-type-writer",
195 "Generate Clang AbstractTypeWriter class"),
196 clEnumValN(GenClangOpcodes
, "gen-clang-opcodes",
197 "Generate Clang constexpr interpreter opcodes"),
198 clEnumValN(GenClangSACheckers
, "gen-clang-sa-checkers",
199 "Generate Clang Static Analyzer checkers"),
200 clEnumValN(GenClangSyntaxNodeList
, "gen-clang-syntax-node-list",
201 "Generate list of Clang Syntax Tree node types"),
202 clEnumValN(GenClangSyntaxNodeClasses
, "gen-clang-syntax-node-classes",
203 "Generate definitions of Clang Syntax Tree node clasess"),
204 clEnumValN(GenClangCommentHTMLTags
, "gen-clang-comment-html-tags",
205 "Generate efficient matchers for HTML tag "
206 "names that are used in documentation comments"),
207 clEnumValN(GenClangCommentHTMLTagsProperties
,
208 "gen-clang-comment-html-tags-properties",
209 "Generate efficient matchers for HTML tag "
211 clEnumValN(GenClangCommentHTMLNamedCharacterReferences
,
212 "gen-clang-comment-html-named-character-references",
213 "Generate function to translate named character "
214 "references to UTF-8 sequences"),
215 clEnumValN(GenClangCommentCommandInfo
, "gen-clang-comment-command-info",
216 "Generate command properties for commands that "
217 "are used in documentation comments"),
218 clEnumValN(GenClangCommentCommandList
, "gen-clang-comment-command-list",
219 "Generate list of commands that are used in "
220 "documentation comments"),
221 clEnumValN(GenClangOpenCLBuiltins
, "gen-clang-opencl-builtins",
222 "Generate OpenCL builtin declaration handlers"),
223 clEnumValN(GenClangOpenCLBuiltinHeader
,
224 "gen-clang-opencl-builtin-header",
225 "Generate OpenCL builtin header"),
226 clEnumValN(GenClangOpenCLBuiltinTests
, "gen-clang-opencl-builtin-tests",
227 "Generate OpenCL builtin declaration tests"),
228 clEnumValN(GenArmNeon
, "gen-arm-neon", "Generate arm_neon.h for clang"),
229 clEnumValN(GenArmFP16
, "gen-arm-fp16", "Generate arm_fp16.h for clang"),
230 clEnumValN(GenArmBF16
, "gen-arm-bf16", "Generate arm_bf16.h for clang"),
231 clEnumValN(GenArmVectorType
, "gen-arm-vector-type",
232 "Generate arm_vector_types.h for clang"),
233 clEnumValN(GenArmNeonSema
, "gen-arm-neon-sema",
234 "Generate ARM NEON sema support for clang"),
235 clEnumValN(GenArmNeonTest
, "gen-arm-neon-test",
236 "Generate ARM NEON tests for clang"),
238 GenArmImmCheckTypes
, "gen-arm-immcheck-types",
239 "Generate arm_immcheck_types.inc (immediate range check types)"
241 clEnumValN(GenArmSveHeader
, "gen-arm-sve-header",
242 "Generate arm_sve.h for clang"),
243 clEnumValN(GenArmSveBuiltins
, "gen-arm-sve-builtins",
244 "Generate arm_sve_builtins.inc for clang"),
245 clEnumValN(GenArmSveBuiltinCG
, "gen-arm-sve-builtin-codegen",
246 "Generate arm_sve_builtin_cg_map.inc for clang"),
247 clEnumValN(GenArmSveTypeFlags
, "gen-arm-sve-typeflags",
248 "Generate arm_sve_typeflags.inc for clang"),
249 clEnumValN(GenArmSveRangeChecks
, "gen-arm-sve-sema-rangechecks",
250 "Generate arm_sve_sema_rangechecks.inc for clang"),
251 clEnumValN(GenArmSveStreamingAttrs
, "gen-arm-sve-streaming-attrs",
252 "Generate arm_sve_streaming_attrs.inc for clang"),
253 clEnumValN(GenArmSmeHeader
, "gen-arm-sme-header",
254 "Generate arm_sme.h for clang"),
255 clEnumValN(GenArmSmeBuiltins
, "gen-arm-sme-builtins",
256 "Generate arm_sme_builtins.inc for clang"),
257 clEnumValN(GenArmSmeBuiltinCG
, "gen-arm-sme-builtin-codegen",
258 "Generate arm_sme_builtin_cg_map.inc for clang"),
259 clEnumValN(GenArmSmeRangeChecks
, "gen-arm-sme-sema-rangechecks",
260 "Generate arm_sme_sema_rangechecks.inc for clang"),
261 clEnumValN(GenArmSmeStreamingAttrs
, "gen-arm-sme-streaming-attrs",
262 "Generate arm_sme_streaming_attrs.inc for clang"),
263 clEnumValN(GenArmSmeBuiltinZAState
, "gen-arm-sme-builtin-za-state",
264 "Generate arm_sme_builtins_za_state.inc for clang"),
265 clEnumValN(GenArmMveHeader
, "gen-arm-mve-header",
266 "Generate arm_mve.h for clang"),
267 clEnumValN(GenArmMveBuiltinDef
, "gen-arm-mve-builtin-def",
268 "Generate ARM MVE builtin definitions for clang"),
269 clEnumValN(GenArmMveBuiltinSema
, "gen-arm-mve-builtin-sema",
270 "Generate ARM MVE builtin sema checks for clang"),
271 clEnumValN(GenArmMveBuiltinCG
, "gen-arm-mve-builtin-codegen",
272 "Generate ARM MVE builtin code-generator for clang"),
273 clEnumValN(GenArmMveBuiltinAliases
, "gen-arm-mve-builtin-aliases",
274 "Generate list of valid ARM MVE builtin aliases for clang"),
275 clEnumValN(GenArmCdeHeader
, "gen-arm-cde-header",
276 "Generate arm_cde.h for clang"),
277 clEnumValN(GenArmCdeBuiltinDef
, "gen-arm-cde-builtin-def",
278 "Generate ARM CDE builtin definitions for clang"),
279 clEnumValN(GenArmCdeBuiltinSema
, "gen-arm-cde-builtin-sema",
280 "Generate ARM CDE builtin sema checks for clang"),
281 clEnumValN(GenArmCdeBuiltinCG
, "gen-arm-cde-builtin-codegen",
282 "Generate ARM CDE builtin code-generator for clang"),
283 clEnumValN(GenArmCdeBuiltinAliases
, "gen-arm-cde-builtin-aliases",
284 "Generate list of valid ARM CDE builtin aliases for clang"),
285 clEnumValN(GenRISCVVectorHeader
, "gen-riscv-vector-header",
286 "Generate riscv_vector.h for clang"),
287 clEnumValN(GenRISCVVectorBuiltins
, "gen-riscv-vector-builtins",
288 "Generate riscv_vector_builtins.inc for clang"),
289 clEnumValN(GenRISCVVectorBuiltinCG
, "gen-riscv-vector-builtin-codegen",
290 "Generate riscv_vector_builtin_cg.inc for clang"),
291 clEnumValN(GenRISCVVectorBuiltinSema
, "gen-riscv-vector-builtin-sema",
292 "Generate riscv_vector_builtin_sema.inc for clang"),
293 clEnumValN(GenRISCVSiFiveVectorBuiltins
,
294 "gen-riscv-sifive-vector-builtins",
295 "Generate riscv_sifive_vector_builtins.inc for clang"),
296 clEnumValN(GenRISCVSiFiveVectorBuiltinCG
,
297 "gen-riscv-sifive-vector-builtin-codegen",
298 "Generate riscv_sifive_vector_builtin_cg.inc for clang"),
299 clEnumValN(GenRISCVSiFiveVectorBuiltinSema
,
300 "gen-riscv-sifive-vector-builtin-sema",
301 "Generate riscv_sifive_vector_builtin_sema.inc for clang"),
302 clEnumValN(GenAttrDocs
, "gen-attr-docs",
303 "Generate attribute documentation"),
304 clEnumValN(GenDiagDocs
, "gen-diag-docs",
305 "Generate diagnostic documentation"),
306 clEnumValN(GenOptDocs
, "gen-opt-docs", "Generate option documentation"),
307 clEnumValN(GenDataCollectors
, "gen-clang-data-collectors",
308 "Generate data collectors for AST nodes"),
309 clEnumValN(GenTestPragmaAttributeSupportedAttributes
,
310 "gen-clang-test-pragma-attribute-supported-attributes",
311 "Generate a list of attributes supported by #pragma clang "
312 "attribute for testing purposes")));
315 ClangComponent("clang-component",
316 cl::desc("Only use warnings from specified component"),
317 cl::value_desc("component"), cl::Hidden
);
319 bool ClangTableGenMain(raw_ostream
&OS
, const RecordKeeper
&Records
) {
322 OS
<< Records
; // No argument, dump all contents
325 EmitJSON(Records
, OS
);
327 case GenClangAttrClasses
:
328 EmitClangAttrClass(Records
, OS
);
330 case GenClangAttrParserStringSwitches
:
331 EmitClangAttrParserStringSwitches(Records
, OS
);
333 case GenClangAttrSubjectMatchRulesParserStringSwitches
:
334 EmitClangAttrSubjectMatchRulesParserStringSwitches(Records
, OS
);
336 case GenClangAttrImpl
:
337 EmitClangAttrImpl(Records
, OS
);
339 case GenClangAttrList
:
340 EmitClangAttrList(Records
, OS
);
342 case GenClangAttrDocTable
:
343 EmitClangAttrDocTable(Records
, OS
);
345 case GenClangAttrSubjectMatchRuleList
:
346 EmitClangAttrSubjectMatchRuleList(Records
, OS
);
348 case GenClangAttrPCHRead
:
349 EmitClangAttrPCHRead(Records
, OS
);
351 case GenClangAttrPCHWrite
:
352 EmitClangAttrPCHWrite(Records
, OS
);
354 case GenClangRegularKeywordAttributeInfo
:
355 EmitClangRegularKeywordAttributeInfo(Records
, OS
);
357 case GenClangAttrHasAttributeImpl
:
358 EmitClangAttrHasAttrImpl(Records
, OS
);
360 case GenClangAttrSpellingListIndex
:
361 EmitClangAttrSpellingListIndex(Records
, OS
);
363 case GenClangAttrASTVisitor
:
364 EmitClangAttrASTVisitor(Records
, OS
);
366 case GenClangAttrTemplateInstantiate
:
367 EmitClangAttrTemplateInstantiate(Records
, OS
);
369 case GenClangAttrParsedAttrList
:
370 EmitClangAttrParsedAttrList(Records
, OS
);
372 case GenClangAttrParsedAttrImpl
:
373 EmitClangAttrParsedAttrImpl(Records
, OS
);
375 case GenClangAttrParsedAttrKinds
:
376 EmitClangAttrParsedAttrKinds(Records
, OS
);
378 case GenClangAttrTextNodeDump
:
379 EmitClangAttrTextNodeDump(Records
, OS
);
381 case GenClangAttrNodeTraverse
:
382 EmitClangAttrNodeTraverse(Records
, OS
);
384 case GenClangBuiltins
:
385 EmitClangBuiltins(Records
, OS
);
387 case GenClangDiagsDefs
:
388 EmitClangDiagsDefs(Records
, OS
, ClangComponent
);
390 case GenClangDiagGroups
:
391 EmitClangDiagGroups(Records
, OS
);
393 case GenClangDiagsIndexName
:
394 EmitClangDiagsIndexName(Records
, OS
);
396 case GenClangCommentNodes
:
397 EmitClangASTNodes(Records
, OS
, CommentNodeClassName
, "");
399 case GenClangDeclNodes
:
400 EmitClangASTNodes(Records
, OS
, DeclNodeClassName
, "Decl",
401 DeclContextNodeClassName
);
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 GenArmImmCheckTypes
:
477 EmitImmCheckTypes(Records
, OS
);
479 case GenArmMveHeader
:
480 EmitMveHeader(Records
, OS
);
482 case GenArmMveBuiltinDef
:
483 EmitMveBuiltinDef(Records
, OS
);
485 case GenArmMveBuiltinSema
:
486 EmitMveBuiltinSema(Records
, OS
);
488 case GenArmMveBuiltinCG
:
489 EmitMveBuiltinCG(Records
, OS
);
491 case GenArmMveBuiltinAliases
:
492 EmitMveBuiltinAliases(Records
, OS
);
494 case GenArmSveHeader
:
495 EmitSveHeader(Records
, OS
);
497 case GenArmSveBuiltins
:
498 EmitSveBuiltins(Records
, OS
);
500 case GenArmSveBuiltinCG
:
501 EmitSveBuiltinCG(Records
, OS
);
503 case GenArmSveTypeFlags
:
504 EmitSveTypeFlags(Records
, OS
);
506 case GenArmSveRangeChecks
:
507 EmitSveRangeChecks(Records
, OS
);
509 case GenArmSveStreamingAttrs
:
510 EmitSveStreamingAttrs(Records
, OS
);
512 case GenArmSmeHeader
:
513 EmitSmeHeader(Records
, OS
);
515 case GenArmSmeBuiltins
:
516 EmitSmeBuiltins(Records
, OS
);
518 case GenArmSmeBuiltinCG
:
519 EmitSmeBuiltinCG(Records
, OS
);
521 case GenArmSmeRangeChecks
:
522 EmitSmeRangeChecks(Records
, OS
);
524 case GenArmSmeStreamingAttrs
:
525 EmitSmeStreamingAttrs(Records
, OS
);
527 case GenArmSmeBuiltinZAState
:
528 EmitSmeBuiltinZAState(Records
, OS
);
530 case GenArmCdeHeader
:
531 EmitCdeHeader(Records
, OS
);
533 case GenArmCdeBuiltinDef
:
534 EmitCdeBuiltinDef(Records
, OS
);
536 case GenArmCdeBuiltinSema
:
537 EmitCdeBuiltinSema(Records
, OS
);
539 case GenArmCdeBuiltinCG
:
540 EmitCdeBuiltinCG(Records
, OS
);
542 case GenArmCdeBuiltinAliases
:
543 EmitCdeBuiltinAliases(Records
, OS
);
545 case GenRISCVVectorHeader
:
546 EmitRVVHeader(Records
, OS
);
548 case GenRISCVVectorBuiltins
:
549 EmitRVVBuiltins(Records
, OS
);
551 case GenRISCVVectorBuiltinCG
:
552 EmitRVVBuiltinCG(Records
, OS
);
554 case GenRISCVVectorBuiltinSema
:
555 EmitRVVBuiltinSema(Records
, OS
);
557 case GenRISCVSiFiveVectorBuiltins
:
558 EmitRVVBuiltins(Records
, OS
);
560 case GenRISCVSiFiveVectorBuiltinCG
:
561 EmitRVVBuiltinCG(Records
, OS
);
563 case GenRISCVSiFiveVectorBuiltinSema
:
564 EmitRVVBuiltinSema(Records
, OS
);
567 EmitClangAttrDocs(Records
, OS
);
570 EmitClangDiagDocs(Records
, OS
);
573 EmitClangOptDocs(Records
, OS
);
575 case GenDataCollectors
:
576 EmitClangDataCollectors(Records
, OS
);
578 case GenTestPragmaAttributeSupportedAttributes
:
579 EmitTestPragmaAttributeSupportedAttributes(Records
, OS
);
587 int main(int argc
, char **argv
) {
588 sys::PrintStackTraceOnErrorSignal(argv
[0]);
589 PrettyStackTraceProgram
X(argc
, argv
);
590 cl::ParseCommandLineOptions(argc
, argv
);
594 return TableGenMain(argv
[0], &ClangTableGenMain
);
598 #if __has_feature(address_sanitizer)
599 #include <sanitizer/lsan_interface.h>
600 // Disable LeakSanitizer for this binary as it has too many leaks that are not
601 // very interesting to fix. See compiler-rt/include/sanitizer/lsan_interface.h .
602 int __lsan_is_turned_off() { return 1; }
603 #endif // __has_feature(address_sanitizer)
604 #endif // defined(__has_feature)