1 # This file is licensed under the Apache License v2.0 with LLVM Exceptions.
2 # See https://llvm.org/LICENSE.txt for license information.
3 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5 load("//llvm:tblgen.bzl", "gentbl")
6 load("//llvm:binary_alias.bzl", "binary_alias")
7 load("//llvm:cc_plugin_library.bzl", "cc_plugin_library")
10 default_visibility = ["//visibility:public"],
11 licenses = ["notice"],
15 "tools/clang-format/clang-format.el",
16 "tools/clang-format/clang-format-test.el",
17 "tools/clang-format/clang-format.py",
18 "tools/clang-rename/clang-rename.el",
19 "tools/extra/clang-include-fixer/tool/clang-include-fixer.el",
20 "tools/extra/clang-include-fixer/tool/clang-include-fixer-test.el",
24 name = "clang-tblgen",
26 "utils/TableGen/*.cpp",
30 "$(STACK_FRAME_UNLIMITED)",
42 name = "diagnostic_defs_gen",
44 "-gen-clang-diags-defs -clang-component=%s" % c,
45 "include/clang/Basic/Diagnostic%sKinds.inc" % c,
61 "-gen-clang-diag-groups",
62 "include/clang/Basic/DiagnosticGroups.inc",
65 "-gen-clang-diags-index-name",
66 "include/clang/Basic/DiagnosticIndexName.inc",
69 tblgen = ":clang-tblgen",
70 td_file = "include/clang/Basic/Diagnostic.td",
71 td_srcs = glob(["include/clang/Basic/*.td"]),
75 name = "basic_arm_neon_inc_gen",
78 "include/clang/Basic/arm_neon.inc",
80 tblgen = ":clang-tblgen",
81 td_file = "include/clang/Basic/arm_neon.td",
83 "include/clang/Basic/arm_neon.td",
84 "include/clang/Basic/arm_neon_incl.td",
89 name = "basic_arm_fp16_inc_gen",
92 "include/clang/Basic/arm_fp16.inc",
94 tblgen = ":clang-tblgen",
95 td_file = "include/clang/Basic/arm_fp16.td",
97 "include/clang/Basic/arm_fp16.td",
98 "include/clang/Basic/arm_neon_incl.td",
103 name = "basic_arm_mve_aliases_gen",
105 "-gen-arm-mve-builtin-aliases",
106 "include/clang/Basic/arm_mve_builtin_aliases.inc",
108 tblgen = ":clang-tblgen",
109 td_file = "include/clang/Basic/arm_mve.td",
111 "include/clang/Basic/arm_mve.td",
112 "include/clang/Basic/arm_mve_defs.td",
117 name = "basic_arm_sve_builtins_gen",
119 "-gen-arm-sve-builtins",
120 "include/clang/Basic/arm_sve_builtins.inc",
122 tblgen = ":clang-tblgen",
123 td_file = "include/clang/Basic/arm_sve.td",
125 "include/clang/Basic/arm_sve.td",
130 name = "basic_arm_sve_builtin_cg_gen",
132 "-gen-arm-sve-builtin-codegen",
133 "include/clang/Basic/arm_sve_builtin_cg.inc",
135 tblgen = ":clang-tblgen",
136 td_file = "include/clang/Basic/arm_sve.td",
138 "include/clang/Basic/arm_sve.td",
143 name = "basic_arm_sve_typeflags_gen",
145 "-gen-arm-sve-typeflags",
146 "include/clang/Basic/arm_sve_typeflags.inc",
148 tblgen = ":clang-tblgen",
149 td_file = "include/clang/Basic/arm_sve.td",
151 "include/clang/Basic/arm_sve.td",
156 name = "basic_arm_sve_sema_rangechecks_gen",
158 "-gen-arm-sve-sema-rangechecks",
159 "include/clang/Basic/arm_sve_sema_rangechecks.inc",
161 tblgen = ":clang-tblgen",
162 td_file = "include/clang/Basic/arm_sve.td",
164 "include/clang/Basic/arm_sve.td",
169 name = "basic_arm_mve_cg_gen",
171 "-gen-arm-mve-builtin-codegen",
172 "include/clang/Basic/arm_mve_builtin_cg.inc",
174 tblgen = ":clang-tblgen",
175 td_file = "include/clang/Basic/arm_mve.td",
177 "include/clang/Basic/arm_mve.td",
178 "include/clang/Basic/arm_mve_defs.td",
183 name = "basic_arm_mve_inc_gen",
185 "-gen-arm-mve-builtin-def",
186 "include/clang/Basic/arm_mve_builtins.inc",
188 tblgen = ":clang-tblgen",
189 td_file = "include/clang/Basic/arm_mve.td",
191 "include/clang/Basic/arm_mve.td",
192 "include/clang/Basic/arm_mve_defs.td",
197 name = "basic_arm_mve_sema_gen",
199 "-gen-arm-mve-builtin-sema",
200 "include/clang/Basic/arm_mve_builtin_sema.inc",
202 tblgen = ":clang-tblgen",
203 td_file = "include/clang/Basic/arm_mve.td",
205 "include/clang/Basic/arm_mve.td",
206 "include/clang/Basic/arm_mve_defs.td",
211 name = "basic_riscv_vector_builtins_gen",
213 "-gen-riscv-vector-builtins",
214 "include/clang/Basic/riscv_vector_builtins.inc",
216 tblgen = ":clang-tblgen",
217 td_file = "include/clang/Basic/riscv_vector.td",
219 "include/clang/Basic/riscv_vector.td",
224 name = "basic_riscv_vector_builtin_cg_gen",
226 "-gen-riscv-vector-builtin-codegen",
227 "include/clang/Basic/riscv_vector_builtin_cg.inc",
229 tblgen = ":clang-tblgen",
230 td_file = "include/clang/Basic/riscv_vector.td",
232 "include/clang/Basic/riscv_vector.td",
237 name = "basic_arm_cde_gen",
239 "-gen-arm-cde-builtin-def",
240 "include/clang/Basic/arm_cde_builtins.inc",
242 tblgen = ":clang-tblgen",
243 td_file = "include/clang/Basic/arm_cde.td",
245 "include/clang/Basic/arm_cde.td",
246 "include/clang/Basic/arm_mve_defs.td",
251 name = "basic_arm_cde_aliases_gen",
253 "-gen-arm-cde-builtin-aliases",
254 "include/clang/Basic/arm_cde_builtin_aliases.inc",
256 tblgen = ":clang-tblgen",
257 td_file = "include/clang/Basic/arm_cde.td",
259 "include/clang/Basic/arm_cde.td",
260 "include/clang/Basic/arm_mve_defs.td",
265 name = "basic_arm_cde_cg_gen",
267 "-gen-arm-cde-builtin-codegen",
268 "include/clang/Basic/arm_cde_builtin_cg.inc",
270 tblgen = ":clang-tblgen",
271 td_file = "include/clang/Basic/arm_cde.td",
273 "include/clang/Basic/arm_cde.td",
274 "include/clang/Basic/arm_mve_defs.td",
279 name = "basic_arm_cde_sema_gen",
281 "-gen-arm-cde-builtin-sema",
282 "include/clang/Basic/arm_cde_builtin_sema.inc",
284 tblgen = ":clang-tblgen",
285 td_file = "include/clang/Basic/arm_cde.td",
287 "include/clang/Basic/arm_cde.td",
288 "include/clang/Basic/arm_mve_defs.td",
293 name = "basic_attr_gen",
296 "-gen-clang-attr-has-attribute-impl",
297 "include/clang/Basic/AttrHasAttributeImpl.inc",
300 "-gen-clang-attr-list",
301 "include/clang/Basic/AttrList.inc",
304 "-gen-clang-attr-subject-match-rule-list",
305 "include/clang/Basic/AttrSubMatchRulesList.inc",
308 tblgen = ":clang-tblgen",
309 td_file = "include/clang/Basic/Attr.td",
311 "include/clang/Basic/ASTNode.td",
312 "include/clang/Basic/Attr.td",
313 "include/clang/Basic/AttrDocs.td",
314 "include/clang/Basic/DeclNodes.td",
315 "include/clang/Basic/StmtNodes.td",
320 name = "libsema_openclbuiltins_inc_gen",
321 strip_include_prefix = "lib/Sema",
323 "-gen-clang-opencl-builtins",
324 "lib/Sema/OpenCLBuiltins.inc",
326 tblgen = ":clang-tblgen",
327 td_file = "lib/Sema/OpenCLBuiltins.td",
329 "lib/Sema/OpenCLBuiltins.td",
333 # Table definition files can be used for documentation:
335 name = "all_table_defs",
336 srcs = glob(["include/**/*.td"]),
340 glob(["include/**/*.td"]),
344 name = "basic_version_gen",
345 outs = ["include/clang/Basic/Version.inc"],
347 "echo '#define CLANG_VERSION 14.0.0' >> $@\n" +
348 "echo '#define CLANG_VERSION_MAJOR 14' >> $@\n" +
349 "echo '#define CLANG_VERSION_MINOR 0' >> $@\n" +
350 "echo '#define CLANG_VERSION_PATCHLEVEL 0' >> $@\n" +
351 "echo '#define CLANG_VERSION_STRING \"14.0.0\"' >> $@\n"
358 "include/clang/Basic/Version.inc",
359 "include/clang/Config/config.h",
361 includes = ["include"],
363 # We rely on the LLVM config library to provide configuration defines.
368 # TODO: This should get replaced with something that actually generates the
369 # correct version number.
371 name = "vcs_version_gen",
372 # This should be under lib/Basic, but because of how the include paths
373 # are passed through bazel, it's easier to drop generated files next to
374 # the other includes.
375 outs = ["include/VCSVersion.inc"],
376 cmd = "echo '#define CLANG_REVISION \"git\"' > $@",
379 # A hacky library to expose some internal headers of the `basic` library to its
380 # own implementation source files using a stripped include prefix rather than
381 # file-relative-inclusion. This is inherently non-modular as these headers will
382 # be repeated in the sources below for file-relative-inclusion.
384 name = "basic_internal_headers",
388 features = ["-header_modules"],
389 strip_include_prefix = "lib/Basic",
395 "include/clang/Basic/Version.inc",
396 "include/VCSVersion.inc",
401 "lib/Basic/Targets/*.cpp",
402 "lib/Basic/Targets/*.h",
405 "include/clang/Basic/*.h",
408 "-DHAVE_VCS_VERSION_INC",
409 "$(STACK_FRAME_UNLIMITED)",
411 includes = ["include"],
413 "include/clang/Basic/arm_fp16.inc",
414 "include/clang/Basic/arm_mve_builtins.inc",
415 "include/clang/Basic/arm_mve_builtin_aliases.inc",
416 "include/clang/Basic/arm_mve_builtin_cg.inc",
417 "include/clang/Basic/arm_mve_builtin_sema.inc",
418 "include/clang/Basic/arm_neon.inc",
419 "include/clang/Basic/AttrHasAttributeImpl.inc",
420 "include/clang/Basic/AttrList.inc",
421 "include/clang/Basic/AttrSubMatchRulesList.inc",
422 "include/clang/Basic/DiagnosticASTKinds.inc",
423 "include/clang/Basic/DiagnosticGroups.inc",
424 "include/clang/Basic/DiagnosticRefactoringKinds.inc",
425 "include/clang/Basic/DiagnosticAnalysisKinds.inc",
426 "include/clang/Basic/DiagnosticSemaKinds.inc",
427 "include/clang/Basic/DiagnosticCommentKinds.inc",
428 "include/clang/Basic/DiagnosticParseKinds.inc",
429 "include/clang/Basic/DiagnosticLexKinds.inc",
430 "include/clang/Basic/DiagnosticSerializationKinds.inc",
431 "include/clang/Basic/DiagnosticFrontendKinds.inc",
432 "include/clang/Basic/DiagnosticDriverKinds.inc",
433 "include/clang/Basic/DiagnosticCrossTUKinds.inc",
434 "include/clang/Basic/DiagnosticCommonKinds.inc",
435 "include/clang/Basic/DiagnosticIndexName.inc",
437 "include/clang/Basic/*.def",
440 ":basic_arm_cde_gen",
441 ":basic_arm_fp16_inc_gen",
442 ":basic_arm_mve_aliases_gen",
443 ":basic_arm_mve_cg_gen",
444 ":basic_arm_mve_inc_gen",
445 ":basic_arm_mve_sema_gen",
446 ":basic_arm_neon_inc_gen",
447 ":basic_arm_sve_builtins_gen",
448 ":basic_arm_sve_typeflags_gen",
450 ":basic_internal_headers",
451 ":basic_riscv_vector_builtin_cg_gen",
452 ":basic_riscv_vector_builtins_gen",
454 ":diagnostic_defs_gen",
457 "//llvm:FrontendOpenMP",
458 "//llvm:Instrumentation",
473 "include/clang/Lex/*.h",
475 includes = ["include"],
483 name = "ast_attr_gen",
486 "-gen-clang-attr-ast-visitor",
487 "include/clang/AST/AttrVisitor.inc",
490 "-gen-clang-attr-classes",
491 "include/clang/AST/Attrs.inc",
494 "-gen-clang-attr-doc-table",
495 "lib/AST/AttrDocTable.inc",
498 "-gen-clang-attr-text-node-dump",
499 "include/clang/AST/AttrTextNodeDump.inc",
502 "-gen-clang-attr-node-traverse",
503 "include/clang/AST/AttrNodeTraverse.inc",
506 "-gen-clang-attr-impl",
507 "include/clang/AST/AttrImpl.inc",
510 tblgen = ":clang-tblgen",
511 td_file = "include/clang/Basic/Attr.td",
513 "include/clang/Basic/Attr.td",
514 "include/clang/Basic/AttrDocs.td",
515 "include/clang/Basic/ASTNode.td",
516 "include/clang/Basic/DeclNodes.td",
517 "include/clang/Basic/StmtNodes.td",
522 name = "ast_decl_nodes_gen",
524 "-gen-clang-decl-nodes",
525 "include/clang/AST/DeclNodes.inc",
527 tblgen = ":clang-tblgen",
528 td_file = "include/clang/Basic/DeclNodes.td",
530 "include/clang/Basic/ASTNode.td",
531 "include/clang/Basic/DeclNodes.td",
536 name = "ast_stmt_nodes_gen",
538 "-gen-clang-stmt-nodes",
539 "include/clang/AST/StmtNodes.inc",
541 tblgen = ":clang-tblgen",
542 td_file = "include/clang/Basic/StmtNodes.td",
544 "include/clang/Basic/ASTNode.td",
545 "include/clang/Basic/StmtNodes.td",
550 name = "ast_comment_nodes_gen",
552 "-gen-clang-comment-nodes",
553 "include/clang/AST/CommentNodes.inc",
555 tblgen = ":clang-tblgen",
556 td_file = "include/clang/Basic/CommentNodes.td",
558 "include/clang/Basic/ASTNode.td",
559 "include/clang/Basic/CommentNodes.td",
564 name = "ast_comment_command_info_gen",
567 "-gen-clang-comment-command-info",
568 "include/clang/AST/CommentCommandInfo.inc",
571 "-gen-clang-comment-command-list",
572 "include/clang/AST/CommentCommandList.inc",
575 tblgen = ":clang-tblgen",
576 td_file = "include/clang/AST/CommentCommands.td",
577 td_srcs = ["include/clang/AST/CommentCommands.td"],
581 name = "ast_comment_html_tags_gen",
583 "-gen-clang-comment-html-tags",
584 "include/clang/AST/CommentHTMLTags.inc",
586 tblgen = ":clang-tblgen",
587 td_file = "include/clang/AST/CommentHTMLTags.td",
588 td_srcs = ["include/clang/AST/CommentHTMLTags.td"],
592 name = "ast_comment_html_tags_properties_gen",
594 "-gen-clang-comment-html-tags-properties",
595 "include/clang/AST/CommentHTMLTagsProperties.inc",
597 tblgen = ":clang-tblgen",
598 td_file = "include/clang/AST/CommentHTMLTags.td",
599 td_srcs = ["include/clang/AST/CommentHTMLTags.td"],
603 name = "ast_comment_html_named_character_references_gen",
605 "-gen-clang-comment-html-named-character-references",
606 "include/clang/AST/CommentHTMLNamedCharacterReferences.inc",
608 tblgen = ":clang-tblgen",
609 td_file = "include/clang/AST/CommentHTMLNamedCharacterReferences.td",
610 td_srcs = ["include/clang/AST/CommentHTMLNamedCharacterReferences.td"],
614 name = "ast_stmt_data_collectors_gen",
616 "-gen-clang-data-collectors",
617 "include/clang/AST/StmtDataCollectors.inc",
619 tblgen = ":clang-tblgen",
620 td_file = "include/clang/AST/StmtDataCollectors.td",
621 td_srcs = ["include/clang/AST/StmtDataCollectors.td"],
625 name = "ast_interp_opcodes_gen",
627 "-gen-clang-opcodes",
628 "lib/AST/Interp/Opcodes.inc",
630 tblgen = ":clang-tblgen",
631 td_file = "lib/AST/Interp/Opcodes.td",
632 td_srcs = ["lib/AST/Interp/Opcodes.td"],
636 name = "ast_properties_base_gen",
639 "-gen-clang-basic-reader",
640 "include/clang/AST/AbstractBasicReader.inc",
643 "-gen-clang-basic-writer",
644 "include/clang/AST/AbstractBasicWriter.inc",
647 tblgen = ":clang-tblgen",
648 td_file = "include/clang/AST/PropertiesBase.td",
649 td_srcs = ["include/clang/AST/PropertiesBase.td"],
653 name = "ast_type_properties_gen",
656 "-gen-clang-type-reader",
657 "include/clang/AST/AbstractTypeReader.inc",
660 "-gen-clang-type-writer",
661 "include/clang/AST/AbstractTypeWriter.inc",
664 tblgen = ":clang-tblgen",
665 td_file = "include/clang/AST/TypeProperties.td",
667 "include/clang/AST/PropertiesBase.td",
668 "include/clang/AST/TypeProperties.td",
669 "include/clang/Basic/ASTNode.td",
670 "include/clang/Basic/TypeNodes.td",
675 name = "type_nodes_gen",
677 "-gen-clang-type-nodes",
678 "include/clang/AST/TypeNodes.inc",
680 tblgen = ":clang-tblgen",
681 td_file = "include/clang/Basic/TypeNodes.td",
683 "include/clang/Basic/ASTNode.td",
684 "include/clang/Basic/TypeNodes.td",
693 "lib/AST/Interp/*.cpp",
694 "lib/AST/Interp/*.h",
697 "include/clang/AST/*.h",
705 "include/clang/AST/AttrImpl.inc",
706 "include/clang/AST/AttrNodeTraverse.inc",
707 "include/clang/AST/Attrs.inc",
708 "include/clang/AST/AttrTextNodeDump.inc",
709 "include/clang/AST/AttrVisitor.inc",
710 "include/clang/AST/CommentCommandInfo.inc",
711 "include/clang/AST/CommentCommandList.inc",
712 "include/clang/AST/CommentHTMLNamedCharacterReferences.inc",
713 "include/clang/AST/CommentHTMLTags.inc",
714 "include/clang/AST/CommentHTMLTagsProperties.inc",
715 "include/clang/AST/CommentNodes.inc",
716 "include/clang/AST/DeclNodes.inc",
717 "include/clang/AST/StmtDataCollectors.inc",
718 "include/clang/AST/StmtNodes.inc",
719 "lib/AST/AttrDocTable.inc",
720 "lib/AST/Interp/Opcodes.inc",
722 "include/clang/AST/*.def",
726 ":ast_comment_command_info_gen",
727 ":ast_comment_html_named_character_references_gen",
728 ":ast_comment_html_tags_gen",
729 ":ast_comment_html_tags_properties_gen",
730 ":ast_comment_nodes_gen",
731 ":ast_decl_nodes_gen",
732 ":ast_interp_opcodes_gen",
733 ":ast_properties_base_gen",
734 ":ast_stmt_data_collectors_gen",
735 ":ast_stmt_nodes_gen",
736 ":ast_type_properties_gen",
740 "//llvm:BinaryFormat",
742 "//llvm:FrontendOpenMP",
754 "include/clang/Index/*.h",
755 "include/clang-c/*.h",
757 includes = ["include"],
774 "lib/Analysis/*.cpp",
778 "include/clang/Analysis/**/*.h",
780 includes = ["include"],
781 textual_hdrs = glob([
782 "include/clang/Analysis/**/*.def",
794 name = "sema_attr_gen",
797 "-gen-clang-attr-parsed-attr-impl",
798 "include/clang/Sema/AttrParsedAttrImpl.inc",
801 "-gen-clang-attr-parsed-attr-kinds",
802 "include/clang/Sema/AttrParsedAttrKinds.inc",
805 "-gen-clang-attr-parsed-attr-list",
806 "include/clang/Sema/AttrParsedAttrList.inc",
809 "-gen-clang-attr-spelling-index",
810 "include/clang/Sema/AttrSpellingListIndex.inc",
813 "-gen-clang-attr-template-instantiate",
814 "include/clang/Sema/AttrTemplateInstantiate.inc",
817 tblgen = ":clang-tblgen",
818 td_file = "include/clang/Basic/Attr.td",
820 "include/clang/Basic/ASTNode.td",
821 "include/clang/Basic/Attr.td",
822 "include/clang/Basic/AttrDocs.td",
823 "include/clang/Basic/DeclNodes.td",
824 "include/clang/Basic/StmtNodes.td",
835 "include/clang/Sema/*.h",
836 "include/clang-c/*.h",
838 copts = ["$(STACK_FRAME_UNLIMITED)"],
839 includes = ["include"],
841 "include/clang/Sema/AttrParsedAttrImpl.inc",
842 "include/clang/Sema/AttrParsedAttrKinds.inc",
843 "include/clang/Sema/AttrParsedAttrList.inc",
844 "include/clang/Sema/AttrSpellingListIndex.inc",
845 "include/clang/Sema/AttrTemplateInstantiate.inc",
846 "lib/Sema/OpenCLBuiltins.inc",
852 ":basic_arm_cde_aliases_gen",
853 ":basic_arm_cde_sema_gen",
854 ":basic_arm_sve_builtins_gen",
855 ":basic_arm_sve_sema_rangechecks_gen",
858 ":libsema_openclbuiltins_inc_gen",
861 "//llvm:AllTargetsAsmParsers",
862 "//llvm:AllTargetsCodeGens",
864 "//llvm:FrontendOpenMP",
872 name = "parse_attr_gen",
875 "-gen-clang-attr-parser-string-switches",
876 "include/clang/Parse/AttrParserStringSwitches.inc",
879 "-gen-clang-attr-subject-match-rules-parser-string-switches",
880 "include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc",
883 tblgen = ":clang-tblgen",
884 td_file = "include/clang/Basic/Attr.td",
886 "include/clang/Basic/ASTNode.td",
887 "include/clang/Basic/Attr.td",
888 "include/clang/Basic/AttrDocs.td",
889 "include/clang/Basic/DeclNodes.td",
890 "include/clang/Basic/StmtNodes.td",
902 "include/clang/Parse/AttrParserStringSwitches.inc",
903 "include/clang/Parse/AttrSubMatchRulesParserStringSwitches.inc",
904 ] + glob(["include/clang/Parse/*.h"]),
905 includes = ["include"],
912 "//llvm:FrontendOpenMP",
920 name = "ast_matchers",
922 "lib/ASTMatchers/*.cpp",
923 "lib/ASTMatchers/*.h",
925 hdrs = glob(["include/clang/ASTMatchers/*.h"]),
926 includes = ["include"],
936 name = "ast_matchers_dynamic",
938 "lib/ASTMatchers/Dynamic/*.cpp",
939 "lib/ASTMatchers/Dynamic/*.h",
941 hdrs = glob(["include/clang/ASTMatchers/Dynamic/*.h"]),
942 copts = ["$(STACK_FRAME_UNLIMITED)"],
943 includes = ["include"],
948 "//llvm:FrontendOpenMP",
959 hdrs = glob(["include/clang/Rewrite/Core/*.h"]),
960 includes = ["include"],
975 hdrs = glob(["include/clang/Testing/*.h"]),
976 includes = ["include"],
984 name = "tooling_core",
986 "lib/Tooling/Core/*.cpp",
987 "lib/Tooling/Core/*.h",
989 hdrs = glob(["include/clang/Tooling/Core/*.h"]),
990 includes = ["include"],
1004 "lib/Tooling/*.cpp",
1006 # Temporarily disable until we support the generated file.
1007 exclude = ["lib/Tooling/NodeIntrospection.cpp"],
1010 "include/clang/Tooling/*.h",
1012 includes = ["include"],
1029 name = "tooling_inclusions",
1031 "lib/Tooling/Inclusions/**/*.cpp",
1034 "include/clang/Tooling/Inclusions/**/*.h",
1046 name = "tooling_refactoring",
1048 "lib/Tooling/Refactoring/**/*.cpp",
1049 "lib/Tooling/Refactoring/**/*.h",
1052 "include/clang/Tooling/Refactoring/**/*.h",
1053 "include/clang/Tooling/Refactoring/**/*.def",
1071 name = "tooling_syntax_gen",
1073 ("-gen-clang-syntax-node-list", "include/clang/Tooling/Syntax/Nodes.inc"),
1074 ("-gen-clang-syntax-node-classes", "include/clang/Tooling/Syntax/NodeClasses.inc"),
1076 tblgen = ":clang-tblgen",
1077 td_file = "include/clang/Tooling/Syntax/Nodes.td",
1079 "include/clang/Tooling/Syntax/Nodes.td",
1080 "include/clang/Tooling/Syntax/Syntax.td",
1085 name = "tooling_syntax",
1086 srcs = glob(["lib/Tooling/Syntax/**/*.cpp"]),
1087 hdrs = glob(["include/clang/Tooling/Syntax/**/*.h"]),
1093 ":tooling_syntax_gen",
1099 name = "tooling_dependency_scanning",
1100 srcs = glob(["lib/Tooling/DependencyScanning/**/*.cpp"]),
1101 hdrs = glob(["include/clang/Tooling/DependencyScanning/**/*.h"]),
1114 name = "transformer",
1115 srcs = glob(["lib/Tooling/Transformer/**/*.cpp"]),
1116 hdrs = glob(["include/clang/Tooling/Transformer/**/*.h"]),
1123 ":tooling_refactoring",
1130 srcs = glob(["lib/Tooling/ASTDiff/*.cpp"]),
1131 hdrs = glob(["include/clang/Tooling/ASTDiff/*.h"]),
1142 srcs = glob(["lib/CrossTU/*.cpp"]),
1143 hdrs = glob(["include/clang/CrossTU/*.h"]),
1163 "lib/Format/FormatTokenLexer.h",
1164 "lib/Format/Macros.h",
1166 "include/clang/Format/*.h",
1168 includes = ["include"],
1173 ":tooling_inclusions",
1180 srcs = glob(["lib/Edit/*.cpp"]),
1181 hdrs = glob(["include/clang/Edit/*.h"]),
1182 includes = ["include"],
1192 name = "static_analyzer_core_options",
1194 "include/clang/StaticAnalyzer/Core/AnalyzerOptions.h",
1197 "include/clang/StaticAnalyzer/Core/Analyses.def",
1198 "include/clang/StaticAnalyzer/Core/AnalyzerOptions.def",
1202 ":static_analyzer_checkers_gen",
1208 name = "static_analyzer_core",
1210 "lib/StaticAnalyzer/Core/**/*.cpp",
1211 "lib/StaticAnalyzer/Core/**/*.h",
1214 "include/clang/StaticAnalyzer/Core/**/*.h",
1216 includes = ["include"],
1217 textual_hdrs = glob([
1218 "include/clang/StaticAnalyzer/Core/**/*.def",
1230 ":static_analyzer_checkers_gen",
1238 name = "static_analyzer_checkers_gen",
1240 "-gen-clang-sa-checkers",
1241 "include/clang/StaticAnalyzer/Checkers/Checkers.inc",
1243 tblgen = ":clang-tblgen",
1244 td_file = "include/clang/StaticAnalyzer/Checkers/Checkers.td",
1246 "include/clang/StaticAnalyzer/Checkers/CheckerBase.td",
1247 "include/clang/StaticAnalyzer/Checkers/Checkers.td",
1252 name = "static_analyzer_checkers",
1254 "lib/StaticAnalyzer/Checkers/**/*.cpp",
1255 "lib/StaticAnalyzer/Checkers/**/*.h",
1258 "include/clang/StaticAnalyzer/Checkers/Checkers.inc",
1260 "include/clang/StaticAnalyzer/Checkers/**/*.h",
1262 copts = ["$(STACK_FRAME_UNLIMITED)"],
1263 includes = ["include"],
1271 ":static_analyzer_checkers_gen",
1272 ":static_analyzer_core",
1278 name = "driver_options_inc_gen",
1280 "-gen-opt-parser-defs",
1281 "include/clang/Driver/Options.inc",
1283 tblgen = "//llvm:llvm-tblgen",
1284 td_file = "include/clang/Driver/Options.td",
1286 "//llvm:include/llvm/Option/OptParser.td",
1296 "lib/Driver/Arch/*.cpp",
1297 "lib/Driver/Arch/*.h",
1298 "lib/Driver/ToolChains/*.cpp",
1299 "lib/Driver/ToolChains/*.h",
1300 "lib/Driver/ToolChains/Arch/*.cpp",
1301 "lib/Driver/ToolChains/Arch/*.h",
1304 "lib/Driver/ToolChains/MSVCSetupApi.h",
1308 "include/clang/Driver/*.h",
1310 copts = ["$(STACK_FRAME_UNLIMITED)"],
1313 # TODO: This is likely a layering issue, but files in Arch are currently
1314 # directly #including "Tools.h".
1317 textual_hdrs = glob([
1318 "include/clang/Driver/*.def",
1324 ":driver_options_inc_gen",
1326 ":static_analyzer_checkers_gen",
1327 "//llvm:BinaryFormat",
1330 "//llvm:ProfileData",
1338 name = "headers_arm_neon_gen",
1341 "lib/Headers/arm_neon.h",
1343 tblgen = ":clang-tblgen",
1344 td_file = "include/clang/Basic/arm_neon.td",
1346 "include/clang/Basic/arm_neon.td",
1347 "include/clang/Basic/arm_neon_incl.td",
1352 name = "headers_arm_fp16_gen",
1355 "lib/Headers/arm_fp16.h",
1357 tblgen = ":clang-tblgen",
1358 td_file = "include/clang/Basic/arm_fp16.td",
1360 "include/clang/Basic/arm_fp16.td",
1361 "include/clang/Basic/arm_neon_incl.td",
1366 name = "headers_arm_mve_gen",
1368 "-gen-arm-mve-header",
1369 "lib/Headers/arm_mve.h",
1371 tblgen = ":clang-tblgen",
1372 td_file = "include/clang/Basic/arm_mve.td",
1374 "include/clang/Basic/arm_mve.td",
1375 "include/clang/Basic/arm_mve_defs.td",
1380 name = "headers_arm_cde_gen",
1382 "-gen-arm-cde-header",
1383 "lib/Headers/arm_cde.h",
1385 tblgen = ":clang-tblgen",
1386 td_file = "include/clang/Basic/arm_cde.td",
1388 "include/clang/Basic/arm_cde.td",
1389 "include/clang/Basic/arm_mve_defs.td",
1394 name = "headers_arm_sve_gen",
1396 "-gen-arm-sve-header",
1397 "lib/Headers/arm_sve.h",
1399 tblgen = ":clang-tblgen",
1400 td_file = "include/clang/Basic/arm_sve.td",
1402 "include/clang/Basic/arm_sve.td",
1407 name = "headers_arm_bf16_gen",
1410 "lib/Headers/arm_bf16.h",
1412 tblgen = ":clang-tblgen",
1413 td_file = "include/clang/Basic/arm_bf16.td",
1415 "include/clang/Basic/arm_bf16.td",
1416 "include/clang/Basic/arm_neon_incl.td",
1421 name = "headers_riscv_vector",
1423 "-gen-riscv-vector-header",
1424 "lib/Headers/riscv_vector.h",
1426 tblgen = ":clang-tblgen",
1427 td_file = "include/clang/Basic/riscv_vector.td",
1429 "include/clang/Basic/riscv_vector.td",
1433 # We generate the set of builtin headers under a special subdirectory in the
1434 # 'bin' section of the bazel output so that they can be used as data
1435 # dependencies. It requires listing explicitly all the generated inputs here.
1436 builtin_headers = glob(["lib/Headers/**/*.h"]) + [
1437 "lib/Headers/arm_cde.h",
1438 "lib/Headers/arm_fp16.h",
1439 "lib/Headers/arm_mve.h",
1440 "lib/Headers/arm_neon.h",
1441 "lib/Headers/arm_sve.h",
1442 "lib/Headers/arm_bf16.h",
1443 "lib/Headers/riscv_vector.h",
1447 name = "builtin_headers_gen",
1448 srcs = builtin_headers,
1449 outs = [hdr.replace("lib/Headers/", "staging/include/") for hdr in builtin_headers],
1451 for src in $(SRCS); do
1452 relsrc=$${src/*external\\/llvm-project\\/clang\\/lib\\/Headers\\/}
1453 target=$(@D)/staging/include/$$relsrc
1454 mkdir -p $$(dirname $$target)
1457 output_to_bindir = 1,
1463 "lib/Frontend/*.cpp",
1467 "include/clang/Frontend/*.h",
1469 copts = ["$(STACK_FRAME_UNLIMITED)"],
1470 data = [":builtin_headers_gen"],
1471 includes = ["include"],
1472 textual_hdrs = glob([
1473 "include/clang/Frontend/*.def",
1480 ":driver_options_inc_gen",
1486 ":static_analyzer_core_options",
1487 "//llvm:BinaryFormat",
1489 "//llvm:BitstreamReader",
1490 "//llvm:BitstreamWriter",
1495 "//llvm:ProfileData",
1503 name = "frontend_rewrite",
1505 "lib/Frontend/Rewrite/*.cpp",
1506 "lib/Frontend/Rewrite/*.h",
1508 hdrs = glob(["include/clang/Rewrite/Frontend/*.h"]),
1509 includes = ["include"],
1525 name = "interpreter",
1527 "lib/Interpreter/*.cpp",
1528 "lib/Interpreter/*.h",
1530 hdrs = glob(["include/clang/Interpreter/*.h"]),
1531 includes = ["include"],
1545 "//llvm:AllTargetsAsmParsers",
1546 "//llvm:AllTargetsCodeGens",
1548 "//llvm:ExecutionEngine",
1559 "lib/CodeGen/*.cpp",
1562 hdrs = glob(["include/clang/CodeGen/*.h"]),
1563 copts = ["$(STACK_FRAME_UNLIMITED)"],
1564 includes = ["include"],
1569 ":basic_arm_cde_cg_gen",
1570 ":basic_arm_sve_builtin_cg_gen",
1571 ":basic_riscv_vector_builtin_cg_gen",
1577 "//llvm:AllTargetsAsmParsers",
1581 "//llvm:BitstreamReader",
1584 "//llvm:Coroutines",
1586 "//llvm:DebugInfoDWARF",
1587 "//llvm:FrontendOpenMP",
1590 "//llvm:InstCombine",
1591 "//llvm:Instrumentation",
1598 "//llvm:ProfileData",
1602 "//llvm:TransformUtils",
1607 name = "static_analyzer_frontend",
1609 "lib/StaticAnalyzer/Frontend/**/*.cpp",
1610 "lib/StaticAnalyzer/Frontend/**/*.h",
1612 hdrs = glob(["include/clang/StaticAnalyzer/Frontend/**/*.h"]),
1613 includes = ["include"],
1624 ":static_analyzer_checkers",
1625 ":static_analyzer_core",
1633 name = "serialization_attr_gen",
1636 "-gen-clang-attr-pch-read",
1637 "include/clang/Serialization/AttrPCHRead.inc",
1640 "-gen-clang-attr-pch-write",
1641 "include/clang/Serialization/AttrPCHWrite.inc",
1644 tblgen = ":clang-tblgen",
1645 td_file = "include/clang/Basic/Attr.td",
1647 "include/clang/Basic/ASTNode.td",
1648 "include/clang/Basic/Attr.td",
1649 "include/clang/Basic/AttrDocs.td",
1650 "include/clang/Basic/DeclNodes.td",
1651 "include/clang/Basic/StmtNodes.td",
1656 name = "serialization",
1658 "include/clang/Serialization/AttrPCHRead.inc",
1659 "include/clang/Serialization/AttrPCHWrite.inc",
1661 "lib/Serialization/*.cpp",
1662 "lib/Serialization/*.h",
1665 "include/clang/Serialization/*.h",
1667 includes = ["include"],
1668 textual_hdrs = glob([
1669 "include/clang/Serialization/*.def",
1676 ":serialization_attr_gen",
1680 "//llvm:BitstreamReader",
1681 "//llvm:BitstreamWriter",
1682 "//llvm:FrontendOpenMP",
1688 name = "frontend_tool",
1690 "lib/FrontendTool/*.cpp",
1691 "lib/FrontendTool/*.h",
1693 hdrs = glob(["include/clang/FrontendTool/*.h"]),
1694 includes = ["include"],
1701 ":frontend_rewrite",
1702 ":static_analyzer_frontend",
1709 name = "arc_migrate",
1711 "lib/ARCMigrate/*.cpp",
1712 "lib/ARCMigrate/*.h",
1714 hdrs = glob(["include/clang/ARCMigrate/*.h"]),
1715 includes = ["include"],
1722 ":frontend_rewrite",
1728 ":static_analyzer_checkers",
1729 ":static_analyzer_core",
1735 name = "libclang_library",
1737 "tools/libclang/*.cpp",
1738 "tools/libclang/*.h",
1740 hdrs = glob(["include/clang-c/*.h"]),
1754 "//llvm:BitstreamReader",
1755 "//llvm:FrontendOpenMP",
1762 name = "c-bindings",
1763 hdrs = glob(["include/clang-c/*.h"]),
1765 ":libclang_library",
1772 deps = [":c-bindings"],
1776 name = "python-sources",
1778 "bindings/python/clang/cindex.py",
1779 "bindings/python/clang/enumerations.py",
1784 name = "python-cindex-examples",
1786 "bindings/python/examples/cindex/cindex-dump.py",
1787 "bindings/python/examples/cindex/cindex-includes.py",
1792 name = "c-index-test",
1795 "tools/c-index-test/c-index-test.c",
1796 "tools/c-index-test/core_main.cpp",
1799 "-Wno-uninitialized",
1821 name = "arcmt-test",
1823 srcs = ["tools/arcmt-test/arcmt-test.cpp"],
1830 ":frontend_rewrite",
1837 name = "c-arcmt-test",
1839 srcs = ["tools/c-arcmt-test/c-arcmt-test.c"],
1840 copts = ["-std=gnu99"],
1851 name = "clang-import-test",
1854 "tools/clang-import-test/*.cpp",
1855 "tools/clang-import-test/*.h",
1872 name = "clang-driver",
1874 "tools/driver/*.cpp",
1878 # Disable stack frame size checks in the driver because
1879 # clang::ensureStackAddressSpace allocates a large array on the stack.
1880 "$(STACK_FRAME_UNLIMITED)",
1890 ":frontend_rewrite",
1896 ":static_analyzer_frontend",
1897 "//llvm:AllTargetsAsmParsers",
1898 "//llvm:AllTargetsCodeGens",
1925 "tools/diagtool/*.cpp",
1926 "tools/diagtool/*.h",
1939 name = "exploded_graph_rewriter",
1941 data = ["utils/analyzer/exploded-graph-rewriter.py"],
1945 name = "module-deps-to-rsp",
1947 data = ["utils/module-deps-to-rsp.py"],
1953 data = ["utils/hmaptool/hmaptool"],
1962 name = "clang-check",
1963 srcs = ["tools/clang-check/ClangCheck.cpp"],
1970 ":frontend_rewrite",
1972 ":static_analyzer_frontend",
1981 name = "clang-format",
1983 "tools/clang-format/ClangFormat.cpp",
1996 name = "clang-diff",
1997 srcs = glob(["tools/clang-diff/*.cpp"]),
2007 name = "clang-offload-bundler",
2008 srcs = glob(["tools/clang-offload-bundler/*.cpp"]),
2021 name = "clang-offload-wrapper",
2022 srcs = glob(["tools/clang-offload-wrapper/*.cpp"]),
2028 "//llvm:TransformUtils",
2029 "//llvm:ir_headers",
2034 name = "clang-refactor",
2036 "tools/clang-refactor/*.cpp",
2037 "tools/clang-refactor/*.h",
2048 ":tooling_refactoring",
2054 name = "clang-rename",
2055 srcs = glob(["tools/clang-rename/*.cpp"]),
2062 ":tooling_refactoring",
2068 name = "clang-repl",
2069 srcs = glob(["tools/clang-repl/*.cpp"]),
2077 "//llvm:LineEditor",
2085 name = "clang-extdef-mapping",
2086 srcs = glob(["tools/clang-extdef-mapping/*.cpp"]),
2099 name = "clang-scan-deps",
2100 srcs = glob(["tools/clang-scan-deps/*.cpp"]),
2105 ":tooling_dependency_scanning",