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(":template_rule.bzl", "template_rule")
6 load(":tblgen.bzl", "gentbl")
7 load(":config.bzl", "llvm_config_defines")
8 load(":targets.bzl", "llvm_targets")
9 load(":enum_targets_gen.bzl", "enum_targets_gen")
10 load(":binary_alias.bzl", "binary_alias")
13 default_visibility = ["//visibility:public"],
14 licenses = ["notice"],
17 exports_files(["LICENSE.TXT"])
19 # It may be tempting to add compiler flags here, but that should be avoided.
20 # The necessary warnings and other compile flags should be provided by the
21 # toolchain or the `.bazelrc` file. This is just a workaround until we have a
22 # widely available feature to enable unlimited stack frame instead of using
23 # this `Make` variable.
25 "$(STACK_FRAME_UNLIMITED)",
29 name = "targets_def_gen",
30 src = "include/llvm/Config/Targets.def.in",
31 out = "include/llvm/Config/Targets.def",
32 macro_name = "TARGET",
33 targets = llvm_targets,
36 # Enabled targets with ASM printers.
37 llvm_target_asm_printers = [
40 if glob(["lib/Target/{}/*AsmPrinter.cpp".format(t)])
44 name = "asm_printers_def_gen",
45 src = "include/llvm/Config/AsmPrinters.def.in",
46 out = "include/llvm/Config/AsmPrinters.def",
47 macro_name = "ASM_PRINTER",
48 targets = llvm_target_asm_printers,
51 # Enabled targets with ASM parsers.
52 llvm_target_asm_parsers = [
55 if glob(["lib/Target/{}/AsmParser/CMakeLists.txt".format(t)])
59 name = "asm_parsers_def_gen",
60 src = "include/llvm/Config/AsmParsers.def.in",
61 out = "include/llvm/Config/AsmParsers.def",
62 macro_name = "ASM_PARSER",
63 targets = llvm_target_asm_parsers,
66 # Enabled targets with disassemblers.
67 llvm_target_disassemblers = [
70 if glob(["lib/Target/{}/Disassembler/CMakeLists.txt".format(t)])
74 name = "disassemblers_def_gen",
75 src = "include/llvm/Config/Disassemblers.def.in",
76 out = "include/llvm/Config/Disassemblers.def",
77 macro_name = "DISASSEMBLER",
78 targets = llvm_target_disassemblers,
81 # Enabled targets with MCA.
85 if glob(["lib/Target/{}/MCA/CMakeLists.txt".format(t)])
89 name = "target_mca_def_gen",
90 src = "include/llvm/Config/TargetMCAs.def.in",
91 out = "include/llvm/Config/TargetMCAs.def",
92 macro_name = "TARGETMCA",
93 targets = llvm_target_mcas,
96 # TODO: Need to replace this with something that actually extracts the git
97 # commit from the LLVM source (submodule or http_archive).
99 name = "version_info_gen",
100 outs = ["include/llvm/Config/VersionInfo.h"],
101 cmd = "echo '#define LLVM_VERSION_INFO \"git\"' > $@",
105 name = "abi_breaking_h_gen",
106 src = "include/llvm/Config/abi-breaking.h.cmake",
107 out = "include/llvm/Config/abi-breaking.h",
109 # Define to enable checks that alter the LLVM C++ ABI
110 "#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS": "#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0",
112 # Define to enable reverse iteration of unordered llvm containers
113 "#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION": "#define LLVM_ENABLE_REVERSE_ITERATION 0",
117 # To enable diff testing out of tree
119 "include/llvm/Config/config.h.cmake",
120 "include/llvm/Config/llvm-config.h.cmake",
121 "include/llvm/Config/abi-breaking.h.cmake",
127 "include/llvm/Config/VersionInfo.h",
128 "include/llvm/Config/abi-breaking.h",
129 "include/llvm/Config/llvm-config.h",
132 defines = llvm_config_defines,
133 includes = ["include"],
135 "include/llvm/Config/AsmParsers.def",
136 "include/llvm/Config/AsmPrinters.def",
137 "include/llvm/Config/Disassemblers.def",
138 "include/llvm/Config/Targets.def",
139 "include/llvm/Config/TargetMCAs.def",
140 # Needed for include scanner to find execinfo.h
141 "include/llvm/Config/config.h",
148 "lib/Demangle/*.cpp",
151 hdrs = glob(["include/llvm/Demangle/*.h"]),
157 name = "generate_vcs_revision",
158 outs = ["include/llvm/Support/VCSRevision.h"],
159 cmd = "echo '#define LLVM_REVISION \"git\"' >> $@\n" +
160 "echo '#undef LLVM_REPOSITORY' >> $@\n",
164 name = "generate_static_extension_registry",
165 outs = ["include/llvm/Support/Extension.def"],
166 cmd = "echo -e '// extension handlers' >> $@\n" +
167 "echo -e '#undef HANDLE_EXTENSION' >> $@\n",
177 # To avoid a dependency cycle.
178 "include/llvm/Option/*.h",
180 "@bazel_tools//src/conditions:windows": glob([
181 "lib/Support/Windows/*.h",
182 "lib/Support/Windows/*.inc",
184 "//conditions:default": glob([
185 "lib/Support/Unix/*.h",
186 "lib/Support/Unix/*.inc",
190 "include/llvm/Support/**/*.h",
191 "include/llvm/ADT/*.h",
193 "include/llvm-c/Core.h",
194 "include/llvm-c/DataTypes.h",
195 "include/llvm-c/Deprecated.h",
196 "include/llvm-c/DisassemblerTypes.h",
197 "include/llvm-c/Error.h",
198 "include/llvm-c/ErrorHandling.h",
199 "include/llvm-c/ExternC.h",
200 "include/llvm-c/Support.h",
201 "include/llvm-c/Types.h",
202 "include/llvm/ExecutionEngine/JITSymbol.h",
203 "include/llvm/Support/Extension.def",
204 "include/llvm/Support/VCSRevision.h",
207 includes = ["include"],
209 "@bazel_tools//src/conditions:windows": [],
210 "@bazel_tools//src/conditions:freebsd": [
216 "//conditions:default": [
222 textual_hdrs = glob([
223 "include/llvm/Support/*.def",
228 # We unconditionally depend on the custom LLVM terminfo wrapper. This
229 # will be an empty library unless terminfo is enabled, in which case it
230 # will both provide the necessary dependencies and configuration
232 "@llvm_terminfo//:terminfo",
233 # We unconditionally depend on the custom LLVM zlib wrapper. This will
234 # be an empty library unless zlib is enabled, in which case it will
235 # both provide the necessary dependencies and configuration defines.
240 # Note: although FileCheck (the binary) is a test utility, some non-test
241 # targets depend on the FileCheck library target.
243 name = "FileCheckLib",
245 "lib/FileCheck/*.cpp",
248 hdrs = glob(["include/llvm/FileCheck/*.h"]),
256 "lib/LineEditor/*.cpp",
257 "lib/LineEditor/*.h",
259 hdrs = glob(["include/llvm/LineEditor/*.h"]),
273 hdrs = glob(["include/llvm/Option/*.h"]),
284 "lib/TableGen/*.cpp",
287 hdrs = glob(["include/llvm/TableGen/*.h"]),
295 # This exists to avoid circular dependencies.
301 "include/llvm/IR/*.h",
304 "include/llvm/LinkAllPasses.h",
307 "include/llvm/IR/Value.def",
308 "include/llvm-c/Comdat.h",
309 "include/llvm-c/DebugInfo.h",
315 name = "BinaryFormat",
317 "lib/BinaryFormat/*.cpp",
318 "lib/BinaryFormat/*.def",
319 "lib/BinaryFormat/*.h",
322 "include/llvm/BinaryFormat/*.h",
325 includes = ["include"],
326 textual_hdrs = glob([
327 "include/llvm/BinaryFormat/*.def",
328 "include/llvm/BinaryFormat/ELFRelocs/*.def",
337 hdrs = glob(["include/llvm/DebugInfo/*.h"]),
346 name = "DebugInfoMSF",
348 "lib/DebugInfo/MSF/*.cpp",
349 "lib/DebugInfo/MSF/*.h",
351 hdrs = glob(["include/llvm/DebugInfo/MSF/*.h"]),
357 name = "DebugInfoCodeView",
359 "lib/DebugInfo/CodeView/*.cpp",
360 "lib/DebugInfo/CodeView/*.h",
363 "include/llvm/DebugInfo/CodeView/*.h",
366 textual_hdrs = glob([
367 "include/llvm/DebugInfo/CodeView/*.def",
377 name = "DebugInfoPDB",
379 "lib/DebugInfo/PDB/*.cpp",
380 "lib/DebugInfo/PDB/*.h",
381 "lib/DebugInfo/PDB/Native/*.cpp",
382 "lib/DebugInfo/PDB/Native/*.h",
385 "include/llvm/DebugInfo/PDB/*.h",
386 "include/llvm/DebugInfo/PDB/Native/*.h",
392 ":DebugInfoCodeView",
403 "lib/Debuginfod/*.cpp",
406 "include/llvm/Debuginfod/*.h",
421 "include/llvm/MC/*.h",
422 "include/llvm/MC/*.def",
423 "include/llvm/MC/*.inc",
428 ":DebugInfoCodeView",
436 name = "DebugInfoDWARF",
438 "lib/DebugInfo/DWARF/*.cpp",
439 "lib/DebugInfo/DWARF/*.h",
441 hdrs = glob(["include/llvm/DebugInfo/DWARF/*.h"]),
455 "lib/DebugInfo/Symbolize/*.cpp",
456 "lib/DebugInfo/Symbolize/*.h",
458 hdrs = glob(["include/llvm/DebugInfo/Symbolize/*.h"]),
475 "utils/TableGen/*.cpp",
476 "utils/TableGen/GlobalISel/*.cpp",
478 # Some tablegen sources include headers from MC, so these have to be
479 # listed here. MC uses headers produced by tablegen, so it cannot be a
480 # regular dependency.
481 "include/llvm/MC/*.h",
483 # We have to include these headers here as well as in the `hdrs` below
484 # to allow the `.cpp` files to use file-relative-inclusion to find
485 # them, even though consumers of this library use inclusion relative to
486 # `utils/TableGen` with the `strip_includes_prefix` of this library.
487 # This mixture appears to be incompatible with header modules.
488 "utils/TableGen/*.h",
489 "utils/TableGen/GlobalISel/*.h",
492 "utils/TableGen/*.h",
493 "utils/TableGen/GlobalISel/*.h",
496 features = ["-header_modules"],
497 strip_include_prefix = "utils/TableGen",
506 name = "llvm-tblgen",
515 name = "intrinsic_enums_gen",
516 tbl_outs = [("-gen-intrinsic-enums", "include/llvm/IR/IntrinsicEnums.inc")],
517 tblgen = ":llvm-tblgen",
518 td_file = "include/llvm/IR/Intrinsics.td",
520 "include/llvm/CodeGen/*.td",
521 "include/llvm/IR/Intrinsics*.td",
526 name = "intrinsics_impl_gen",
527 tbl_outs = [("-gen-intrinsic-impl", "include/llvm/IR/IntrinsicImpl.inc")],
528 tblgen = ":llvm-tblgen",
529 td_file = "include/llvm/IR/Intrinsics.td",
531 "include/llvm/CodeGen/*.td",
532 "include/llvm/IR/Intrinsics*.td",
536 # Note that the intrinsics are not currently set up so they can be pruned for
538 llvm_target_intrinsics_list = [
541 "intrinsic_prefix": "aarch64",
545 "intrinsic_prefix": "amdgcn",
549 "intrinsic_prefix": "arm",
553 "intrinsic_prefix": "bpf",
557 "intrinsic_prefix": "hexagon",
561 "intrinsic_prefix": "mips",
565 "intrinsic_prefix": "nvvm",
569 "intrinsic_prefix": "ppc",
573 "intrinsic_prefix": "r600",
577 "intrinsic_prefix": "riscv",
581 "intrinsic_prefix": "s390",
585 "intrinsic_prefix": "ve",
588 "name": "WebAssembly",
589 "intrinsic_prefix": "wasm",
593 "intrinsic_prefix": "x86",
597 "intrinsic_prefix": "xcore",
603 name = "intrinsic_" + target["name"] + "_gen",
605 "-gen-intrinsic-enums -intrinsic-prefix=" + target["intrinsic_prefix"],
606 "include/llvm/IR/Intrinsics" + target["name"] + ".h",
608 tblgen = ":llvm-tblgen",
609 td_file = "include/llvm/IR/Intrinsics.td",
611 "include/llvm/CodeGen/*.td",
612 "include/llvm/IR/*.td",
615 ] for target in llvm_target_intrinsics_list]
618 name = "attributes_gen",
619 tbl_outs = [("-gen-attrs", "include/llvm/IR/Attributes.inc")],
620 tblgen = ":llvm-tblgen",
621 td_file = "include/llvm/IR/Attributes.td",
623 "include/llvm/IR/Attributes.td",
624 "include/llvm/IR/AttributesAMDGPU.td",
629 name = "BitstreamReader",
631 "lib/Bitstream/Reader/*.cpp",
632 "lib/Bitstream/Reader/*.h",
635 "include/llvm/Bitstream/BitCodes.h",
636 "include/llvm/Bitstream/BitstreamReader.h",
645 name = "BitstreamWriter",
647 "lib/Bitstream/Writer/*.h",
650 "include/llvm/Bitstream/BitCodes.h",
651 "include/llvm/Bitstream/BitstreamWriter.h",
666 exclude = ["lib/Remarks/RemarkLinker.cpp"],
670 "include/llvm/Remarks/*.h",
672 exclude = ["include/llvm/Remarks/RemarkLinker.h"],
674 "include/llvm-c/Remarks.h",
685 name = "remark_linker",
686 srcs = ["lib/Remarks/RemarkLinker.cpp"],
687 hdrs = ["include/llvm/Remarks/RemarkLinker.h"],
696 name = "llvm_intrinsics_headers",
698 "include/llvm/IR/Intrinsics" + target["name"] + ".h"
699 for target in llvm_target_intrinsics_list
712 "include/llvm/IR/*.h",
715 "include/llvm/LinkAllPasses.h",
718 "include/llvm-c/Comdat.h",
719 "include/llvm-c/DebugInfo.h",
720 ] + [":llvm_intrinsics_headers"],
722 textual_hdrs = glob(["include/llvm/IR/*.def"]),
729 ":intrinsic_enums_gen",
730 ":intrinsics_impl_gen",
737 "lib/Bitcode/Reader/*.cpp",
738 "lib/Bitcode/Reader/*.h",
741 "include/llvm-c/BitReader.h",
742 "include/llvm/Bitcode/BitcodeAnalyzer.h",
743 "include/llvm/Bitcode/BitcodeCommon.h",
744 "include/llvm/Bitcode/BitcodeReader.h",
745 "include/llvm/Bitcode/LLVMBitCodes.h",
759 "lib/MC/MCParser/*.cpp",
760 "lib/MC/MCParser/*.h",
762 hdrs = glob(["include/llvm/MC/MCParser/*.h"]),
775 "lib/TextAPI/**/*.cpp",
778 "include/llvm/TextAPI/**/*.h",
779 "include/llvm/TextAPI/**/*.def",
780 "lib/TextAPI/**/*.h",
796 "include/llvm/Object/*.h",
798 "include/llvm-c/Object.h",
816 "lib/ObjectYAML/*.cpp",
817 "lib/ObjectYAML/*.h",
819 hdrs = glob(["include/llvm/ObjectYAML/*.h"]),
823 ":DebugInfoCodeView",
830 name = "ProfileData",
832 "lib/ProfileData/*.cpp",
833 "lib/ProfileData/*.h",
836 "include/llvm/ProfileData/*.h",
837 "include/llvm/ProfileData/*.inc",
851 "lib/ProfileData/Coverage/*.cpp",
852 "lib/ProfileData/Coverage/*.h",
854 hdrs = glob(["include/llvm/ProfileData/Coverage/*.h"]),
867 "lib/Analysis/*.cpp",
869 "lib/Analysis/*.def",
874 "include/llvm/Analysis/*.h",
875 "include/llvm/Analysis/Utils/*.h",
878 "include/llvm-c/Analysis.h",
879 "include/llvm-c/Initialization.h",
882 textual_hdrs = glob([
883 "include/llvm/Analysis/*.def",
898 "lib/Bitcode/Writer/*.cpp",
899 "lib/Bitcode/Writer/*.h",
902 "include/llvm-c/BitWriter.h",
903 "include/llvm/Bitcode/BitcodeCommon.h",
904 "include/llvm/Bitcode/BitcodeWriter.h",
905 "include/llvm/Bitcode/BitcodeWriterPass.h",
906 "include/llvm/Bitcode/LLVMBitCodes.h",
927 "include/llvm/Target/*.h",
929 "include/llvm-c/Target.h",
930 "include/llvm-c/TargetMachine.h",
949 hdrs = glob(["include/llvm/DWP/*.h"]),
961 name = "TransformUtils",
963 "lib/Transforms/Utils/*.cpp",
964 "lib/Transforms/Utils/*.h",
966 hdrs = glob(["include/llvm/Transforms/Utils/*.h"]) + [
967 "include/llvm/Transforms/Utils.h",
968 "include/llvm-c/Transforms/Utils.h",
983 name = "InstCombineTableGen",
984 strip_include_prefix = "lib/Target/AMDGPU",
986 "-gen-searchable-tables",
987 "lib/Target/AMDGPU/InstCombineTables.inc",
989 tblgen = ":llvm-tblgen",
990 td_file = "lib/Target/AMDGPU/InstCombineTables.td",
992 "include/llvm/CodeGen/*.td",
993 "include/llvm/IR/Intrinsics*.td",
995 "lib/Target/AMDGPU/InstCombineTables.td",
996 "include/llvm/TableGen/SearchableTable.td",
1001 name = "InstCombine",
1003 "lib/Transforms/InstCombine/*.cpp",
1004 "lib/Transforms/InstCombine/*.h",
1006 hdrs = glob(["include/llvm/Transforms/InstCombine/*.h"]) + [
1007 "include/llvm-c/Transforms/InstCombine.h",
1013 ":InstCombineTableGen",
1022 name = "AggressiveInstCombine",
1024 "lib/Transforms/AggressiveInstCombine/*.cpp",
1025 "lib/Transforms/AggressiveInstCombine/*.h",
1028 "include/llvm-c/Transforms/AggressiveInstCombine.h",
1029 "include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h",
1041 name = "Instrumentation",
1043 "lib/Transforms/Instrumentation/*.cpp",
1044 "lib/Transforms/Instrumentation/*.h",
1045 "lib/Transforms/Instrumentation/*.inc",
1047 hdrs = glob(["include/llvm/Transforms/Instrumentation/*.h"]) + [
1048 "include/llvm/Transforms/Instrumentation.h",
1066 "lib/Transforms/ObjCARC/*.cpp",
1067 "lib/Transforms/ObjCARC/*.h",
1069 hdrs = ["include/llvm/Transforms/ObjCARC.h"],
1084 "lib/Transforms/Scalar/*.cpp",
1085 "lib/Transforms/Scalar/*.h",
1087 hdrs = glob(["include/llvm/Transforms/Scalar/*.h"]) + [
1088 "include/llvm-c/Transforms/Scalar.h",
1089 "include/llvm/Transforms/Scalar.h",
1093 ":AggressiveInstCombine",
1108 "lib/Transforms/Vectorize/*.cpp",
1109 "lib/Transforms/Vectorize/*.h",
1112 "include/llvm/Transforms/Vectorize/*.h",
1114 "include/llvm-c/Transforms/Vectorize.h",
1115 "include/llvm/Transforms/Vectorize.h",
1129 name = "omp_td_files",
1131 "include/llvm/Frontend/OpenMP/*.td",
1132 "include/llvm/Frontend/Directive/*.td",
1140 ("--gen-directive-decl", "include/llvm/Frontend/OpenMP/OMP.h.inc"),
1142 tblgen = ":llvm-tblgen",
1143 td_file = "include/llvm/Frontend/OpenMP/OMP.td",
1144 td_srcs = [":omp_td_files"],
1148 name = "omp_gen_impl",
1151 ("--gen-directive-impl", "include/llvm/Frontend/OpenMP/OMP.inc"),
1153 tblgen = ":llvm-tblgen",
1154 td_file = "include/llvm/Frontend/OpenMP/OMP.td",
1155 td_srcs = [":omp_td_files"],
1159 name = "FrontendOpenMP",
1161 "lib/Frontend/OpenMP/*.cpp",
1164 "include/llvm/Frontend/OpenMP/*.h",
1165 "include/llvm/Frontend/OpenMP/OMP/*.h",
1166 "include/llvm/Frontend/*.h",
1168 "include/llvm/Frontend/OpenMP/OMP.h.inc",
1169 "include/llvm/Frontend/OpenMP/OMP.inc",
1172 textual_hdrs = glob([
1173 "include/llvm/Frontend/OpenMP/*.def",
1185 name = "acc_td_files",
1187 "include/llvm/Frontend/OpenACC/*.td",
1188 "include/llvm/Frontend/Directive/*.td",
1196 ("--gen-directive-decl", "include/llvm/Frontend/OpenACC/ACC.h.inc"),
1198 tblgen = ":llvm-tblgen",
1199 td_file = "include/llvm/Frontend/OpenACC/ACC.td",
1200 td_srcs = [":acc_td_files"],
1204 name = "acc_gen_impl",
1207 ("--gen-directive-impl", "include/llvm/Frontend/OpenACC/ACC.inc"),
1209 tblgen = ":llvm-tblgen",
1210 td_file = "include/llvm/Frontend/OpenACC/ACC.td",
1211 td_srcs = [":acc_td_files"],
1215 name = "FrontendOpenACC",
1217 "lib/Frontend/OpenACC/*.cpp",
1219 "include/llvm/Frontend/OpenACC/ACC.inc",
1222 "include/llvm/Frontend/OpenACC/*.h",
1223 ]) + ["include/llvm/Frontend/OpenACC/ACC.h.inc"],
1236 "lib/AsmParser/*.cpp",
1237 "lib/AsmParser/*.h",
1239 hdrs = glob(["include/llvm/AsmParser/*.h"]),
1251 "lib/IRReader/*.cpp",
1255 "include/llvm/IRReader/*.h",
1257 "include/llvm-c/IRReader.h",
1276 "include/llvm/Linker/*.h",
1278 "include/llvm-c/Linker.h",
1292 "lib/Transforms/IPO/*.cpp",
1293 "lib/Transforms/IPO/*.h",
1296 "include/llvm/Transforms/IPO/*.h",
1298 "include/llvm-c/Transforms/IPO.h",
1299 "include/llvm-c/Transforms/PassManagerBuilder.h",
1300 "include/llvm/Transforms/IPO.h",
1304 ":AggressiveInstCombine",
1330 "lib/Transforms/CFGuard/*.cpp",
1331 "lib/Transforms/CFGuard/*.h",
1333 hdrs = ["include/llvm/Transforms/CFGuard.h"],
1342 name = "Coroutines",
1344 "lib/Transforms/Coroutines/*.cpp",
1345 "lib/Transforms/Coroutines/*.h",
1348 "include/llvm-c/Transforms/Coroutines.h",
1349 "include/llvm/Transforms/Coroutines.h",
1350 "include/llvm/Transforms/Coroutines/CoroCleanup.h",
1351 "include/llvm/Transforms/Coroutines/CoroEarly.h",
1352 "include/llvm/Transforms/Coroutines/CoroElide.h",
1353 "include/llvm/Transforms/Coroutines/CoroSplit.h",
1367 # Meta-target for clients which depend on all of the transforms libraries.
1369 name = "common_transforms",
1371 ":AggressiveInstCombine",
1384 name = "asm_printer_defs",
1386 textual_hdrs = glob(["lib/CodeGen/AsmPrinter/*.def"]),
1393 "lib/CodeGen/**/*.cpp",
1394 "lib/CodeGen/**/*.h",
1395 "lib/CodeGen/SelectionDAG/*.cpp",
1396 "lib/CodeGen/SelectionDAG/*.h",
1400 "include/llvm/LinkAllPasses.h",
1403 "include/llvm/CodeGen/**/*.h",
1407 textual_hdrs = glob([
1408 "include/llvm/CodeGen/**/*.def",
1409 "include/llvm/CodeGen/**/*.inc",
1418 ":DebugInfoCodeView",
1429 ":asm_printer_defs",
1435 name = "MCDisassembler",
1437 "lib/MC/MCDisassembler/*.cpp",
1438 "lib/MC/MCDisassembler/*.h",
1441 "include/llvm/MC/MCDisassembler/*.h",
1443 "include/llvm-c/Disassembler.h",
1453 llvm_target_lib_list = [lib for lib in [
1456 "short_name": "AArch64",
1458 ("-gen-register-bank", "lib/Target/AArch64/AArch64GenRegisterBank.inc"),
1459 ("-gen-register-info", "lib/Target/AArch64/AArch64GenRegisterInfo.inc"),
1460 ("-gen-instr-info", "lib/Target/AArch64/AArch64GenInstrInfo.inc"),
1461 ("-gen-emitter", "lib/Target/AArch64/AArch64GenMCCodeEmitter.inc"),
1462 ("-gen-pseudo-lowering", "lib/Target/AArch64/AArch64GenMCPseudoLowering.inc"),
1463 ("-gen-asm-writer", "lib/Target/AArch64/AArch64GenAsmWriter.inc"),
1464 ("-gen-asm-writer -asmwriternum=1", "lib/Target/AArch64/AArch64GenAsmWriter1.inc"),
1465 ("-gen-asm-matcher", "lib/Target/AArch64/AArch64GenAsmMatcher.inc"),
1466 ("-gen-dag-isel", "lib/Target/AArch64/AArch64GenDAGISel.inc"),
1467 ("-gen-fast-isel", "lib/Target/AArch64/AArch64GenFastISel.inc"),
1468 ("-gen-global-isel", "lib/Target/AArch64/AArch64GenGlobalISel.inc"),
1469 ("-gen-global-isel-combiner -combiners=AArch64O0PreLegalizerCombinerHelper", "lib/Target/AArch64/AArch64GenO0PreLegalizeGICombiner.inc"),
1470 ("-gen-global-isel-combiner -combiners=AArch64PreLegalizerCombinerHelper", "lib/Target/AArch64/AArch64GenPreLegalizeGICombiner.inc"),
1471 ("-gen-global-isel-combiner -combiners=AArch64PostLegalizerCombinerHelper", "lib/Target/AArch64/AArch64GenPostLegalizeGICombiner.inc"),
1472 ("-gen-global-isel-combiner -combiners=AArch64PostLegalizerLoweringHelper", "lib/Target/AArch64/AArch64GenPostLegalizeGILowering.inc"),
1473 ("-gen-callingconv", "lib/Target/AArch64/AArch64GenCallingConv.inc"),
1474 ("-gen-subtarget", "lib/Target/AArch64/AArch64GenSubtargetInfo.inc"),
1475 ("-gen-disassembler", "lib/Target/AArch64/AArch64GenDisassemblerTables.inc"),
1476 ("-gen-searchable-tables", "lib/Target/AArch64/AArch64GenSystemOperands.inc"),
1481 "short_name": "ARM",
1483 ("-gen-register-bank", "lib/Target/ARM/ARMGenRegisterBank.inc"),
1484 ("-gen-register-info", "lib/Target/ARM/ARMGenRegisterInfo.inc"),
1485 ("-gen-searchable-tables", "lib/Target/ARM/ARMGenSystemRegister.inc"),
1486 ("-gen-instr-info", "lib/Target/ARM/ARMGenInstrInfo.inc"),
1487 ("-gen-emitter", "lib/Target/ARM/ARMGenMCCodeEmitter.inc"),
1488 ("-gen-pseudo-lowering", "lib/Target/ARM/ARMGenMCPseudoLowering.inc"),
1489 ("-gen-asm-writer", "lib/Target/ARM/ARMGenAsmWriter.inc"),
1490 ("-gen-asm-matcher", "lib/Target/ARM/ARMGenAsmMatcher.inc"),
1491 ("-gen-dag-isel", "lib/Target/ARM/ARMGenDAGISel.inc"),
1492 ("-gen-fast-isel", "lib/Target/ARM/ARMGenFastISel.inc"),
1493 ("-gen-global-isel", "lib/Target/ARM/ARMGenGlobalISel.inc"),
1494 ("-gen-callingconv", "lib/Target/ARM/ARMGenCallingConv.inc"),
1495 ("-gen-subtarget", "lib/Target/ARM/ARMGenSubtargetInfo.inc"),
1496 ("-gen-disassembler", "lib/Target/ARM/ARMGenDisassemblerTables.inc"),
1501 "short_name": "AMDGPU",
1503 ("-gen-register-bank", "lib/Target/AMDGPU/AMDGPUGenRegisterBank.inc"),
1504 ("-gen-register-info", "lib/Target/AMDGPU/AMDGPUGenRegisterInfo.inc"),
1505 ("-gen-instr-info", "lib/Target/AMDGPU/AMDGPUGenInstrInfo.inc"),
1506 ("-gen-emitter", "lib/Target/AMDGPU/AMDGPUGenMCCodeEmitter.inc"),
1507 ("-gen-pseudo-lowering", "lib/Target/AMDGPU/AMDGPUGenMCPseudoLowering.inc"),
1508 ("-gen-asm-writer", "lib/Target/AMDGPU/AMDGPUGenAsmWriter.inc"),
1509 ("-gen-asm-matcher", "lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc"),
1510 ("-gen-dag-isel", "lib/Target/AMDGPU/AMDGPUGenDAGISel.inc"),
1511 ("-gen-callingconv", "lib/Target/AMDGPU/AMDGPUGenCallingConv.inc"),
1512 ("-gen-subtarget", "lib/Target/AMDGPU/AMDGPUGenSubtargetInfo.inc"),
1513 ("-gen-disassembler", "lib/Target/AMDGPU/AMDGPUGenDisassemblerTables.inc"),
1514 ("-gen-searchable-tables", "lib/Target/AMDGPU/AMDGPUGenSearchableTables.inc"),
1517 ":amdgpu_isel_target_gen",
1523 "short_name": "AVR",
1525 ("-gen-asm-matcher", "lib/Target/AVR/AVRGenAsmMatcher.inc"),
1526 ("-gen-asm-writer", "lib/Target/AVR/AVRGenAsmWriter.inc"),
1527 ("-gen-callingconv", "lib/Target/AVR/AVRGenCallingConv.inc"),
1528 ("-gen-dag-isel", "lib/Target/AVR/AVRGenDAGISel.inc"),
1529 ("-gen-disassembler", "lib/Target/AVR/AVRGenDisassemblerTables.inc"),
1530 ("-gen-emitter", "lib/Target/AVR/AVRGenMCCodeEmitter.inc"),
1531 ("-gen-instr-info", "lib/Target/AVR/AVRGenInstrInfo.inc"),
1532 ("-gen-register-info", "lib/Target/AVR/AVRGenRegisterInfo.inc"),
1533 ("-gen-subtarget", "lib/Target/AVR/AVRGenSubtargetInfo.inc"),
1538 "short_name": "BPF",
1540 ("-gen-asm-writer", "lib/Target/BPF/BPFGenAsmWriter.inc"),
1541 ("-gen-asm-matcher", "lib/Target/BPF/BPFGenAsmMatcher.inc"),
1542 ("-gen-callingconv", "lib/Target/BPF/BPFGenCallingConv.inc"),
1543 ("-gen-dag-isel", "lib/Target/BPF/BPFGenDAGISel.inc"),
1544 ("-gen-disassembler", "lib/Target/BPF/BPFGenDisassemblerTables.inc"),
1545 ("-gen-emitter", "lib/Target/BPF/BPFGenMCCodeEmitter.inc"),
1546 ("-gen-instr-info", "lib/Target/BPF/BPFGenInstrInfo.inc"),
1547 ("-gen-register-info", "lib/Target/BPF/BPFGenRegisterInfo.inc"),
1548 ("-gen-subtarget", "lib/Target/BPF/BPFGenSubtargetInfo.inc"),
1553 "short_name": "Hexagon",
1555 ("-gen-asm-matcher", "lib/Target/Hexagon/HexagonGenAsmMatcher.inc"),
1556 ("-gen-asm-writer", "lib/Target/Hexagon/HexagonGenAsmWriter.inc"),
1557 ("-gen-callingconv", "lib/Target/Hexagon/HexagonGenCallingConv.inc"),
1558 ("-gen-dag-isel", "lib/Target/Hexagon/HexagonGenDAGISel.inc"),
1559 ("-gen-dfa-packetizer", "lib/Target/Hexagon/HexagonGenDFAPacketizer.inc"),
1560 ("-gen-disassembler", "lib/Target/Hexagon/HexagonGenDisassemblerTables.inc"),
1561 ("-gen-instr-info", "lib/Target/Hexagon/HexagonGenInstrInfo.inc"),
1562 ("-gen-emitter", "lib/Target/Hexagon/HexagonGenMCCodeEmitter.inc"),
1563 ("-gen-register-info", "lib/Target/Hexagon/HexagonGenRegisterInfo.inc"),
1564 ("-gen-subtarget", "lib/Target/Hexagon/HexagonGenSubtargetInfo.inc"),
1569 "short_name": "Lanai",
1571 ("-gen-asm-matcher", "lib/Target/Lanai/LanaiGenAsmMatcher.inc"),
1572 ("-gen-asm-writer", "lib/Target/Lanai/LanaiGenAsmWriter.inc"),
1573 ("-gen-callingconv", "lib/Target/Lanai/LanaiGenCallingConv.inc"),
1574 ("-gen-dag-isel", "lib/Target/Lanai/LanaiGenDAGISel.inc"),
1575 ("-gen-disassembler", "lib/Target/Lanai/LanaiGenDisassemblerTables.inc"),
1576 ("-gen-emitter", "lib/Target/Lanai/LanaiGenMCCodeEmitter.inc"),
1577 ("-gen-instr-info", "lib/Target/Lanai/LanaiGenInstrInfo.inc"),
1578 ("-gen-register-info", "lib/Target/Lanai/LanaiGenRegisterInfo.inc"),
1579 ("-gen-subtarget", "lib/Target/Lanai/LanaiGenSubtargetInfo.inc"),
1584 "short_name": "Mips",
1586 ("-gen-asm-matcher", "lib/Target/Mips/MipsGenAsmMatcher.inc"),
1587 ("-gen-asm-writer", "lib/Target/Mips/MipsGenAsmWriter.inc"),
1588 ("-gen-callingconv", "lib/Target/Mips/MipsGenCallingConv.inc"),
1589 ("-gen-dag-isel", "lib/Target/Mips/MipsGenDAGISel.inc"),
1590 ("-gen-disassembler", "lib/Target/Mips/MipsGenDisassemblerTables.inc"),
1591 ("-gen-emitter", "lib/Target/Mips/MipsGenMCCodeEmitter.inc"),
1592 ("-gen-exegesis", "lib/Target/Mips/MipsGenExegesis.inc"),
1593 ("-gen-fast-isel", "lib/Target/Mips/MipsGenFastISel.inc"),
1594 ("-gen-global-isel", "lib/Target/Mips/MipsGenGlobalISel.inc"),
1595 ("-gen-instr-info", "lib/Target/Mips/MipsGenInstrInfo.inc"),
1596 ("-gen-pseudo-lowering", "lib/Target/Mips/MipsGenMCPseudoLowering.inc"),
1597 ("-gen-register-bank", "lib/Target/Mips/MipsGenRegisterBank.inc"),
1598 ("-gen-register-info", "lib/Target/Mips/MipsGenRegisterInfo.inc"),
1599 ("-gen-subtarget", "lib/Target/Mips/MipsGenSubtargetInfo.inc"),
1604 "short_name": "MSP430",
1606 ("-gen-asm-matcher", "lib/Target/MSP430/MSP430GenAsmMatcher.inc"),
1607 ("-gen-asm-writer", "lib/Target/MSP430/MSP430GenAsmWriter.inc"),
1608 ("-gen-callingconv", "lib/Target/MSP430/MSP430GenCallingConv.inc"),
1609 ("-gen-dag-isel", "lib/Target/MSP430/MSP430GenDAGISel.inc"),
1610 ("-gen-disassembler", "lib/Target/MSP430/MSP430GenDisassemblerTables.inc"),
1611 ("-gen-emitter", "lib/Target/MSP430/MSP430GenMCCodeEmitter.inc"),
1612 ("-gen-instr-info", "lib/Target/MSP430/MSP430GenInstrInfo.inc"),
1613 ("-gen-register-info", "lib/Target/MSP430/MSP430GenRegisterInfo.inc"),
1614 ("-gen-subtarget", "lib/Target/MSP430/MSP430GenSubtargetInfo.inc"),
1619 "short_name": "NVPTX",
1621 ("-gen-register-info", "lib/Target/NVPTX/NVPTXGenRegisterInfo.inc"),
1622 ("-gen-instr-info", "lib/Target/NVPTX/NVPTXGenInstrInfo.inc"),
1623 ("-gen-asm-writer", "lib/Target/NVPTX/NVPTXGenAsmWriter.inc"),
1624 ("-gen-dag-isel", "lib/Target/NVPTX/NVPTXGenDAGISel.inc"),
1625 ("-gen-subtarget", "lib/Target/NVPTX/NVPTXGenSubtargetInfo.inc"),
1630 "short_name": "PPC",
1632 ("-gen-asm-writer", "lib/Target/PowerPC/PPCGenAsmWriter.inc"),
1633 ("-gen-asm-matcher", "lib/Target/PowerPC/PPCGenAsmMatcher.inc"),
1634 ("-gen-emitter", "lib/Target/PowerPC/PPCGenMCCodeEmitter.inc"),
1635 ("-gen-register-info", "lib/Target/PowerPC/PPCGenRegisterInfo.inc"),
1636 ("-gen-instr-info", "lib/Target/PowerPC/PPCGenInstrInfo.inc"),
1637 ("-gen-dag-isel", "lib/Target/PowerPC/PPCGenDAGISel.inc"),
1638 ("-gen-fast-isel", "lib/Target/PowerPC/PPCGenFastISel.inc"),
1639 ("-gen-callingconv", "lib/Target/PowerPC/PPCGenCallingConv.inc"),
1640 ("-gen-subtarget", "lib/Target/PowerPC/PPCGenSubtargetInfo.inc"),
1641 ("-gen-disassembler", "lib/Target/PowerPC/PPCGenDisassemblerTables.inc"),
1642 ("-gen-register-bank", "lib/Target/PowerPC/PPCGenRegisterBank.inc"),
1643 ("-gen-global-isel", "lib/Target/PowerPC/PPCGenGlobalISel.inc"),
1648 "short_name": "Sparc",
1650 ("-gen-asm-writer", "lib/Target/Sparc/SparcGenAsmWriter.inc"),
1651 ("-gen-asm-matcher", "lib/Target/Sparc/SparcGenAsmMatcher.inc"),
1652 ("-gen-emitter", "lib/Target/Sparc/SparcGenMCCodeEmitter.inc"),
1653 ("-gen-register-info", "lib/Target/Sparc/SparcGenRegisterInfo.inc"),
1654 ("-gen-instr-info", "lib/Target/Sparc/SparcGenInstrInfo.inc"),
1655 ("-gen-dag-isel", "lib/Target/Sparc/SparcGenDAGISel.inc"),
1656 ("-gen-callingconv", "lib/Target/Sparc/SparcGenCallingConv.inc"),
1657 ("-gen-subtarget", "lib/Target/Sparc/SparcGenSubtargetInfo.inc"),
1658 ("-gen-disassembler", "lib/Target/Sparc/SparcGenDisassemblerTables.inc"),
1663 "short_name": "SystemZ",
1665 ("-gen-asm-matcher", "lib/Target/SystemZ/SystemZGenAsmMatcher.inc"),
1666 ("-gen-asm-writer", "lib/Target/SystemZ/SystemZGenAsmWriter.inc"),
1667 ("-gen-callingconv", "lib/Target/SystemZ/SystemZGenCallingConv.inc"),
1668 ("-gen-dag-isel", "lib/Target/SystemZ/SystemZGenDAGISel.inc"),
1669 ("-gen-disassembler", "lib/Target/SystemZ/SystemZGenDisassemblerTables.inc"),
1670 ("-gen-emitter", "lib/Target/SystemZ/SystemZGenMCCodeEmitter.inc"),
1671 ("-gen-instr-info", "lib/Target/SystemZ/SystemZGenInstrInfo.inc"),
1672 ("-gen-register-info", "lib/Target/SystemZ/SystemZGenRegisterInfo.inc"),
1673 ("-gen-subtarget", "lib/Target/SystemZ/SystemZGenSubtargetInfo.inc"),
1678 "short_name": "RISCV",
1680 ("-gen-asm-matcher", "lib/Target/RISCV/RISCVGenAsmMatcher.inc"),
1681 ("-gen-asm-writer", "lib/Target/RISCV/RISCVGenAsmWriter.inc"),
1682 ("-gen-compress-inst-emitter", "lib/Target/RISCV/RISCVGenCompressInstEmitter.inc"),
1683 ("-gen-dag-isel", "lib/Target/RISCV/RISCVGenDAGISel.inc"),
1684 ("-gen-disassembler", "lib/Target/RISCV/RISCVGenDisassemblerTables.inc"),
1685 ("-gen-global-isel", "lib/Target/RISCV/RISCVGenGlobalISel.inc"),
1686 ("-gen-instr-info", "lib/Target/RISCV/RISCVGenInstrInfo.inc"),
1687 ("-gen-emitter", "lib/Target/RISCV/RISCVGenMCCodeEmitter.inc"),
1688 ("-gen-pseudo-lowering", "lib/Target/RISCV/RISCVGenMCPseudoLowering.inc"),
1689 ("-gen-register-bank", "lib/Target/RISCV/RISCVGenRegisterBank.inc"),
1690 ("-gen-register-info", "lib/Target/RISCV/RISCVGenRegisterInfo.inc"),
1691 ("-gen-subtarget", "lib/Target/RISCV/RISCVGenSubtargetInfo.inc"),
1692 ("-gen-searchable-tables", "lib/Target/RISCV/RISCVGenSearchableTables.inc"),
1696 "name": "WebAssembly",
1697 "short_name": "WebAssembly",
1699 ("-gen-disassembler", "lib/Target/WebAssembly/WebAssemblyGenDisassemblerTables.inc"),
1700 ("-gen-asm-writer", "lib/Target/WebAssembly/WebAssemblyGenAsmWriter.inc"),
1701 ("-gen-instr-info", "lib/Target/WebAssembly/WebAssemblyGenInstrInfo.inc"),
1702 ("-gen-dag-isel", "lib/Target/WebAssembly/WebAssemblyGenDAGISel.inc"),
1703 ("-gen-fast-isel", "lib/Target/WebAssembly/WebAssemblyGenFastISel.inc"),
1704 ("-gen-emitter", "lib/Target/WebAssembly/WebAssemblyGenMCCodeEmitter.inc"),
1705 ("-gen-register-info", "lib/Target/WebAssembly/WebAssemblyGenRegisterInfo.inc"),
1706 ("-gen-subtarget", "lib/Target/WebAssembly/WebAssemblyGenSubtargetInfo.inc"),
1707 ("-gen-asm-matcher", "lib/Target/WebAssembly/WebAssemblyGenAsmMatcher.inc"),
1712 "short_name": "X86",
1714 ("-gen-register-bank", "lib/Target/X86/X86GenRegisterBank.inc"),
1715 ("-gen-register-info", "lib/Target/X86/X86GenRegisterInfo.inc"),
1716 ("-gen-disassembler", "lib/Target/X86/X86GenDisassemblerTables.inc"),
1717 ("-gen-instr-info", "lib/Target/X86/X86GenInstrInfo.inc"),
1718 ("-gen-asm-writer", "lib/Target/X86/X86GenAsmWriter.inc"),
1719 ("-gen-asm-writer -asmwriternum=1", "lib/Target/X86/X86GenAsmWriter1.inc"),
1720 ("-gen-asm-matcher", "lib/Target/X86/X86GenAsmMatcher.inc"),
1721 ("-gen-dag-isel", "lib/Target/X86/X86GenDAGISel.inc"),
1722 ("-gen-fast-isel", "lib/Target/X86/X86GenFastISel.inc"),
1723 ("-gen-global-isel", "lib/Target/X86/X86GenGlobalISel.inc"),
1724 ("-gen-callingconv", "lib/Target/X86/X86GenCallingConv.inc"),
1725 ("-gen-subtarget", "lib/Target/X86/X86GenSubtargetInfo.inc"),
1726 ("-gen-x86-EVEX2VEX-tables", "lib/Target/X86/X86GenEVEX2VEXTables.inc"),
1727 ("-gen-exegesis", "lib/Target/X86/X86GenExegesis.inc"),
1732 "short_name": "XCore",
1734 ("-gen-asm-writer", "lib/Target/XCore/XCoreGenAsmWriter.inc"),
1735 ("-gen-callingconv", "lib/Target/XCore/XCoreGenCallingConv.inc"),
1736 ("-gen-dag-isel", "lib/Target/XCore/XCoreGenDAGISel.inc"),
1737 ("-gen-disassembler", "lib/Target/XCore/XCoreGenDisassemblerTables.inc"),
1738 ("-gen-instr-info", "lib/Target/XCore/XCoreGenInstrInfo.inc"),
1739 ("-gen-register-info", "lib/Target/XCore/XCoreGenRegisterInfo.inc"),
1740 ("-gen-subtarget", "lib/Target/XCore/XCoreGenSubtargetInfo.inc"),
1743 ] if lib["name"] in llvm_targets]
1746 name = "x86_target_layering_problem_hdrs",
1747 textual_hdrs = ["lib/Target/X86/X86InstrInfo.h"],
1751 name = "common_target_td_sources",
1753 "include/llvm/CodeGen/*.td",
1754 "include/llvm/Frontend/Directive/*.td",
1755 "include/llvm/IR/Intrinsics*.td",
1756 "include/llvm/TableGen/*.td",
1757 "include/llvm/Target/*.td",
1758 "include/llvm/Target/GlobalISel/*.td",
1763 name = "amdgpu_isel_target_gen",
1764 strip_include_prefix = "lib/Target/AMDGPU",
1766 ("-gen-global-isel", "lib/Target/AMDGPU/AMDGPUGenGlobalISel.inc"),
1767 ("-gen-global-isel-combiner -combiners=AMDGPUPreLegalizerCombinerHelper", "lib/Target/AMDGPU/AMDGPUGenPreLegalizeGICombiner.inc"),
1768 ("-gen-global-isel-combiner -combiners=AMDGPUPostLegalizerCombinerHelper", "lib/Target/AMDGPU/AMDGPUGenPostLegalizeGICombiner.inc"),
1769 ("-gen-global-isel-combiner -combiners=AMDGPURegBankCombinerHelper", "lib/Target/AMDGPU/AMDGPUGenRegBankGICombiner.inc"),
1771 tblgen = ":llvm-tblgen",
1772 td_file = "lib/Target/AMDGPU/AMDGPUGISel.td",
1774 ":common_target_td_sources",
1776 "lib/Target/AMDGPU/*.td",
1781 name = "r600_target_gen",
1782 strip_include_prefix = "lib/Target/AMDGPU",
1784 ("-gen-asm-writer", "lib/Target/AMDGPU/R600GenAsmWriter.inc"),
1785 ("-gen-callingconv", "lib/Target/AMDGPU/R600GenCallingConv.inc"),
1786 ("-gen-dag-isel", "lib/Target/AMDGPU/R600GenDAGISel.inc"),
1787 ("-gen-dfa-packetizer", "lib/Target/AMDGPU/R600GenDFAPacketizer.inc"),
1788 ("-gen-instr-info", "lib/Target/AMDGPU/R600GenInstrInfo.inc"),
1789 ("-gen-emitter", "lib/Target/AMDGPU/R600GenMCCodeEmitter.inc"),
1790 ("-gen-register-info", "lib/Target/AMDGPU/R600GenRegisterInfo.inc"),
1791 ("-gen-subtarget", "lib/Target/AMDGPU/R600GenSubtargetInfo.inc"),
1793 tblgen = ":llvm-tblgen",
1794 td_file = "lib/Target/AMDGPU/R600.td",
1796 ":common_target_td_sources",
1798 "lib/Target/AMDGPU/*.td",
1804 name = target["name"] + "CommonTableGen",
1805 strip_include_prefix = "lib/Target/" + target["name"],
1806 tbl_outs = target["tbl_outs"],
1807 tblgen = ":llvm-tblgen",
1808 # MSVC isn't happy with long string literals, while other compilers
1809 # which support them get significant compile time improvements with
1810 # them enabled. Ideally this flag would only be enabled on Windows via
1811 # a select() on `@bazel_tools//src/conditions:windows,`, but that would
1812 # require refactoring gentbl from a macro into a rule.
1813 # TODO(#92): Refactor gentbl to support this use
1814 tblgen_args = "--long-string-literals=0",
1815 td_file = "lib/Target/" + target["name"] + "/" + target["short_name"] + ".td",
1817 ":common_target_td_sources",
1819 "lib/Target/" + target["name"] + "/*.td",
1820 "lib/Target/" + target["name"] + "/GISel/*.td",
1822 deps = target.get("tbl_deps", []),
1825 name = target["name"] + "Info",
1826 srcs = ["lib/Target/" + target["name"] + "/TargetInfo/" + target["name"] + "TargetInfo.cpp"],
1827 hdrs = glob(["lib/Target/" + target["name"] + "/TargetInfo/*.h"]),
1829 # Workaround for https://github.com/bazelbuild/bazel/issues/3828
1830 # TODO(gcmn): Remove this when upgrading to a Bazel version containing
1831 # https://github.com/bazelbuild/bazel/commit/e3b7e17b05f1
1832 includes = ["lib/Target/" + target["name"]],
1833 strip_include_prefix = "lib/Target/" + target["name"],
1835 ":" + target["name"] + "CommonTableGen",
1840 # We cannot separate the `Utils` and `MCTargetDesc` sublibraries of
1841 # a number of targets due to crisscrossing inclusion of headers.
1843 name = target["name"] + "UtilsAndDesc",
1845 "lib/Target/" + target["name"] + "/MCTargetDesc/*.cpp",
1846 "lib/Target/" + target["name"] + "/Utils/*.cpp",
1848 # We have to include these headers here as well as in the `hdrs`
1849 # below to allow the `.cpp` files to use file-relative-inclusion to
1850 # find them, even though consumers of this library use inclusion
1851 # relative to the target with the `strip_includes_prefix` of this
1852 # library. This mixture is likely incompatible with header modules.
1853 "lib/Target/" + target["name"] + "/MCTargetDesc/*.h",
1854 "lib/Target/" + target["name"] + "/Utils/*.h",
1857 "lib/Target/" + target["name"] + "/MCTargetDesc/*.h",
1858 "lib/Target/" + target["name"] + "/Utils/*.h",
1860 # This a bit of a hack to allow us to expose common, internal
1861 # target header files to other libraries within the target via
1862 # target-relative includes. This usage of headers is inherently
1863 # non-modular as there is a mixture of target-relative inclusion
1864 # using this rule and file-relative inclusion using the repeated
1865 # listing of these headers in the `srcs` of subsequent rules.
1866 "lib/Target/" + target["name"] + "/*.h",
1868 # FIXME: The entries below should be `textual_hdrs` instead of
1869 # `hdrs`, but unfortunately that doesn't work with
1870 # `strip_include_prefix`:
1871 # https://github.com/bazelbuild/bazel/issues/12424
1873 # Once that issue is fixed and released, we can switch this to
1874 # `textual_hdrs` and remove the feature disabling the various Bazel
1875 # features (both current and under-development) that motivated the
1876 # distinction between these two.
1877 "lib/Target/" + target["name"] + "/*.def",
1878 "lib/Target/" + target["name"] + "/*.inc",
1885 strip_include_prefix = "lib/Target/" + target["name"],
1888 # Depending on `:CodeGen` headers in this library is almost
1889 # certainly a layering problem in numerous targets.
1891 ":DebugInfoCodeView",
1897 ":" + target["name"] + "CommonTableGen",
1898 ":" + target["name"] + "Info",
1902 name = target["name"] + "CodeGen",
1904 "lib/Target/" + target["name"] + "/GISel/*.cpp",
1905 "lib/Target/" + target["name"] + "/GISel/*.h",
1906 "lib/Target/" + target["name"] + "/*.cpp",
1907 "lib/Target/" + target["name"] + "/*.h",
1909 hdrs = ["lib/Target/" + target["name"] + "/" + target["short_name"] + ".h"],
1911 strip_include_prefix = "lib/Target/" + target["name"],
1912 textual_hdrs = glob([
1913 "lib/Target/" + target["name"] + "/*.def",
1914 "lib/Target/" + target["name"] + "/*.inc",
1924 ":Passes", # TODO(chandlerc): Likely a layering violation.
1932 ":" + target["name"] + "CommonTableGen",
1933 ":" + target["name"] + "Info",
1934 ":" + target["name"] + "UtilsAndDesc",
1938 name = target["name"] + "AsmParser",
1940 "lib/Target/" + target["name"] + "/AsmParser/*.cpp",
1941 "lib/Target/" + target["name"] + "/AsmParser/*.h",
1950 ":" + target["name"] + "CodeGen",
1951 ":" + target["name"] + "CommonTableGen",
1952 ":" + target["name"] + "UtilsAndDesc",
1955 # This target is a bit of a hack to allow us to expose internal
1956 # disassembler header files via internal target-relative include paths.
1957 # This usage of headers is inherently non-modular as there is a mixture of
1958 # target-relative inclusion using this rule and same-directory inclusion
1959 # using the repeated listing of these headers in the `srcs` below.
1961 name = target["name"] + "DisassemblerInternalHeaders",
1962 # FIXME: This should be `textual_hdrs` instead of `hdrs`, but
1963 # unfortunately that doesn't work with `strip_include_prefix`:
1964 # https://github.com/bazelbuild/bazel/issues/12424
1966 # Once that issue is fixed and released, we can switch this to
1967 # `textual_hdrs` and remove the feature disabling the various Bazel
1968 # features (both current and under-development) that motivated the
1969 # distinction between these two.
1971 "lib/Target/" + target["name"] + "/Disassembler/*.h",
1977 strip_include_prefix = "lib/Target/" + target["name"],
1980 name = target["name"] + "Disassembler",
1982 "lib/Target/" + target["name"] + "/Disassembler/*.cpp",
1983 "lib/Target/" + target["name"] + "/Disassembler/*.c",
1984 "lib/Target/" + target["name"] + "/Disassembler/*.h",
1994 ":" + target["name"] + "CodeGen",
1995 ":" + target["name"] + "DisassemblerInternalHeaders",
1996 ":" + target["name"] + "CommonTableGen",
1997 ":" + target["name"] + "UtilsAndDesc",
2001 name = target["name"] + "TargetMCA",
2003 "lib/Target/" + target["name"] + "/MCA/*.cpp",
2004 "lib/Target/" + target["name"] + "/MCA/*.c",
2005 "lib/Target/" + target["name"] + "/MCA/*.h",
2013 ":" + target["name"] + "DisassemblerInternalHeaders",
2014 ":" + target["name"] + "Info",
2015 ":" + target["name"] + "UtilsAndDesc",
2018 ] for target in llvm_target_lib_list]
2021 name = "AllTargetsCodeGens",
2024 target["name"] + "CodeGen"
2025 for target in llvm_target_lib_list
2030 name = "AllTargetsAsmParsers",
2033 target["name"] + "AsmParser"
2034 for target in llvm_target_lib_list
2039 name = "AllTargetsDisassemblers",
2042 target["name"] + "Disassembler"
2043 for target in llvm_target_lib_list
2048 name = "AllTargetsMCAs",
2051 target["name"] + "TargetMCA"
2052 for target in llvm_target_lib_list
2057 name = "pass_registry_def",
2059 textual_hdrs = ["lib/Passes/PassRegistry.def"],
2063 name = "MLPolicies",
2065 "lib/Analysis/ML/*.cpp",
2066 "lib/Analysis/ML/*.h",
2069 "include/llvm/Analysis/ML/*.h",
2085 hdrs = glob(["include/llvm/Passes/*.h"]) + ["include/llvm-c/Transforms/PassBuilder.h"],
2096 ":common_transforms",
2098 ":pass_registry_def",
2109 "include/llvm/LTO/*.h",
2110 "include/llvm/LTO/legacy/*.h",
2112 "include/llvm-c/lto.h",
2130 ":common_transforms",
2136 name = "ExecutionEngine",
2138 "lib/ExecutionEngine/*.cpp",
2139 "lib/ExecutionEngine/*.h",
2140 "lib/ExecutionEngine/RuntimeDyld/*.cpp",
2141 "lib/ExecutionEngine/RuntimeDyld/*.h",
2142 "lib/ExecutionEngine/RuntimeDyld/Targets/*.cpp",
2143 "lib/ExecutionEngine/RuntimeDyld/Targets/*.h",
2147 "include/llvm/ExecutionEngine/*.h",
2150 "include/llvm/ExecutionEngine/MCJIT*.h",
2151 "include/llvm/ExecutionEngine/OProfileWrapper.h",
2154 "include/llvm-c/ExecutionEngine.h",
2165 ":OrcTargetProcess",
2174 name = "Interpreter",
2176 "lib/ExecutionEngine/Interpreter/*.cpp",
2177 "lib/ExecutionEngine/Interpreter/*.h",
2179 hdrs = ["include/llvm/ExecutionEngine/Interpreter.h"],
2194 "lib/ExecutionEngine/JITLink/*.cpp",
2195 "lib/ExecutionEngine/JITLink/*.h",
2198 "include/llvm/ExecutionEngine/JITLink/*.h",
2204 ":OrcTargetProcess",
2213 "lib/ExecutionEngine/MCJIT/*.cpp",
2214 "lib/ExecutionEngine/MCJIT/*.h",
2216 hdrs = glob(["include/llvm/ExecutionEngine/MCJIT*.h"]),
2233 "lib/ExecutionEngine/Orc/*.cpp",
2234 "lib/ExecutionEngine/Orc/*.h",
2237 "include/llvm/ExecutionEngine/Orc/*.h",
2238 "include/llvm/ExecutionEngine/Orc/RPC/*.h",
2240 "include/llvm-c/LLJIT.h",
2241 "include/llvm-c/Orc.h",
2242 "include/llvm-c/OrcEE.h",
2254 ":OrcTargetProcess",
2265 "lib/ExecutionEngine/Orc/Shared/*.cpp",
2268 "include/llvm/ExecutionEngine/Orc/Shared/*.h",
2287 name = "OrcTargetProcess",
2289 "lib/ExecutionEngine/Orc/TargetProcess/*.cpp",
2290 "lib/ExecutionEngine/Orc/TargetProcess/*.h",
2293 "include/llvm/ExecutionEngine/Orc/TargetProcess/*.h",
2313 name = "DWARFLinker",
2315 "lib/DWARFLinker/*.cpp",
2316 "lib/DWARFLinker/*.h",
2318 hdrs = glob(["include/llvm/DWARFLinker/*.h"]),
2328 name = "DllOptionsTableGen",
2329 strip_include_prefix = "lib/ToolDrivers/llvm-dlltool",
2331 "-gen-opt-parser-defs",
2332 "lib/ToolDrivers/llvm-dlltool/Options.inc",
2334 tblgen = ":llvm-tblgen",
2335 td_file = "lib/ToolDrivers/llvm-dlltool/Options.td",
2336 td_srcs = ["include/llvm/Option/OptParser.td"],
2340 name = "DlltoolDriver",
2341 srcs = glob(["lib/ToolDrivers/llvm-dlltool/*.cpp"]),
2342 hdrs = glob(["include/llvm/ToolDrivers/llvm-dlltool/*.h"]),
2345 ":DllOptionsTableGen",
2353 name = "LibOptionsTableGen",
2354 strip_include_prefix = "lib/ToolDrivers/llvm-lib",
2356 "-gen-opt-parser-defs",
2357 "lib/ToolDrivers/llvm-lib/Options.inc",
2359 tblgen = ":llvm-tblgen",
2360 td_file = "lib/ToolDrivers/llvm-lib/Options.td",
2361 td_srcs = ["include/llvm/Option/OptParser.td"],
2366 srcs = glob(["lib/ToolDrivers/llvm-lib/*.cpp"]),
2367 hdrs = glob(["include/llvm/ToolDrivers/llvm-lib/*.h"]),
2371 ":LibOptionsTableGen",
2379 name = "InterfaceStub",
2381 "lib/InterfaceStub/*.cpp",
2382 "lib/InterfaceStub/*.h",
2385 "include/llvm/InterfaceStub/*.h",
2396 name = "WindowsManifest",
2398 "lib/WindowsManifest/*.cpp",
2401 "include/llvm/WindowsManifest/*.h",
2405 # Libxml2 is required to process Windows manifests. Without this,
2406 # lld uses Microsoft mt.exe instead, which is not cross-platform.
2410 "manual", # External dependency (libxml)
2411 "nobuildkite", # TODO(gcmn): Fix remote execution and re-enable
2419 # FIXME: This library should use `textual_hdrs` instead of `hdrs` as we don't
2420 # want to parse or build modules for them (and haven't duplicated the necessary
2421 # dependencies), but unfortunately that doesn't work with
2422 # `strip_include_prefix`: https://github.com/bazelbuild/bazel/issues/12424
2424 # For now, we simply disable features that might rely on the headers parsing.
2426 name = "llvm-objcopy-headers",
2427 hdrs = glob(["tools/llvm-objcopy/**/*.h"]),
2432 strip_include_prefix = "tools/llvm-objcopy",
2442 "include/llvm/MCA/**/*.h",
2454 name = "llvm-mca-headers",
2456 "tools/llvm-mca/*.h",
2457 "tools/llvm-mca/Views/*.h",
2459 strip_include_prefix = "tools/llvm-mca",
2468 hdrs = glob(["include/llvm/XRay/*.h"]),
2479 "tools/llvm-exegesis/lib/*.cpp",
2480 "tools/llvm-exegesis/lib/X86/*.cpp",
2481 "tools/llvm-exegesis/lib/X86/*.h",
2482 # We have to include these headers here as well as in the `hdrs` below
2483 # to allow the `.cpp` files to use file-relative-inclusion to find
2484 # them, even though consumers of this library use inclusion relative to
2485 # `tools/llvm-exegesis/lib` with the `strip_includes_prefix` of this
2486 # library. This mixture appears to be incompatible with header modules.
2487 "tools/llvm-exegesis/lib/*.h",
2489 hdrs = glob(["tools/llvm-exegesis/lib/*.h"]),
2490 copts = llvm_copts + ["-DHAVE_LIBPFM=1"],
2491 defines = ["LLVM_EXEGESIS_INITIALIZE_NATIVE_TARGET=InitializeX86ExegesisTarget"],
2492 features = ["-header_modules"],
2493 strip_include_prefix = "tools/llvm-exegesis/lib",
2495 "manual", # External dependency (libpfm4)
2496 "nobuildkite", # TODO(chandlerc): Add support for fetching and building libpfm4 and enable this.
2499 ":AllTargetsAsmParsers",
2500 ":AllTargetsCodeGens",
2515 ################################################################################
2516 # LLVM toolchain and development binaries
2519 name = "DsymutilTableGen",
2520 strip_include_prefix = "tools/dsymutil",
2522 "-gen-opt-parser-defs",
2523 "tools/dsymutil/Options.inc",
2525 tblgen = ":llvm-tblgen",
2526 td_file = "tools/dsymutil/Options.td",
2527 td_srcs = ["include/llvm/Option/OptParser.td"],
2533 "tools/dsymutil/*.cpp",
2534 "tools/dsymutil/*.h",
2539 ":AllTargetsCodeGens",
2545 ":DsymutilTableGen",
2565 ":AllTargetsAsmParsers",
2566 ":AllTargetsCodeGens",
2587 # ll scripts rely on symbols from dependent
2588 # libraries being resolvable.
2590 "@bazel_tools//src/conditions:windows": [],
2591 "@bazel_tools//src/conditions:darwin": [],
2592 "//conditions:default": [
2593 "-Wl,--undefined=_ZTIi",
2594 "-Wl,--export-dynamic-symbol=_ZTIi",
2595 "-Wl,--export-dynamic-symbol=__cxa_begin_catch",
2596 "-Wl,--export-dynamic-symbol=__cxa_end_catch",
2597 "-Wl,--export-dynamic-symbol=__gxx_personality_v0",
2598 "-Wl,--export-dynamic-symbol=__cxa_allocate_exception",
2599 "-Wl,--export-dynamic-symbol=__cxa_throw",
2600 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBWrapper",
2601 "-Wl,--export-dynamic-symbol=llvm_orc_registerEHFrameSectionWrapper",
2602 "-Wl,--export-dynamic-symbol=llvm_orc_deregisterEHFrameSectionWrapper",
2607 ":AllTargetsAsmParsers",
2608 ":AllTargetsCodeGens",
2628 "tools/llvm-ar/*.cpp",
2629 "tools/llvm-ar/*.h",
2634 ":AllTargetsAsmParsers",
2635 ":AllTargetsCodeGens",
2644 # We need to run llvm-ar with different basenames to make it run with
2645 # different behavior.
2647 name = "llvm-dlltool",
2648 binary = ":llvm-ar",
2653 binary = ":llvm-ar",
2657 name = "llvm-ranlib",
2658 binary = ":llvm-ar",
2664 "tools/llvm-as/*.cpp",
2665 "tools/llvm-as/*.h",
2679 name = "llvm-bcanalyzer",
2681 "tools/llvm-bcanalyzer/*.cpp",
2682 "tools/llvm-bcanalyzer/*.h",
2695 "tools/llvm-cat/*.cpp",
2709 name = "llvm-cfi-verify",
2711 "tools/llvm-cfi-verify/*.cpp",
2712 "tools/llvm-cfi-verify/lib/*.cpp",
2713 "tools/llvm-cfi-verify/lib/*.h",
2718 ":AllTargetsAsmParsers",
2719 ":AllTargetsCodeGens",
2720 ":AllTargetsDisassemblers",
2735 "tools/llvm-cov/*.cpp",
2736 "tools/llvm-cov/*.h",
2750 name = "CvtResTableGen",
2751 strip_include_prefix = "tools/llvm-cvtres",
2753 "-gen-opt-parser-defs",
2754 "tools/llvm-cvtres/Opts.inc",
2756 tblgen = ":llvm-tblgen",
2757 td_file = "tools/llvm-cvtres/Opts.td",
2758 td_srcs = ["include/llvm/Option/OptParser.td"],
2762 name = "llvm-cvtres",
2764 "tools/llvm-cvtres/*.cpp",
2765 "tools/llvm-cvtres/*.h",
2778 name = "llvm-cxxdump",
2780 "tools/llvm-cxxdump/*.cpp",
2781 "tools/llvm-cxxdump/*.h",
2786 ":AllTargetsCodeGens",
2794 name = "llvm-cxxmap",
2796 "tools/llvm-cxxmap/*.cpp",
2797 "tools/llvm-cxxmap/*.h",
2807 name = "CxxfiltOptsTableGen",
2808 strip_include_prefix = "tools/llvm-cxxfilt",
2810 "-gen-opt-parser-defs",
2811 "tools/llvm-cxxfilt/Opts.inc",
2813 tblgen = ":llvm-tblgen",
2814 td_file = "tools/llvm-cxxfilt/Opts.td",
2815 td_srcs = ["include/llvm/Option/OptParser.td"],
2819 name = "llvm-cxxfilt",
2821 "tools/llvm-cxxfilt/*.cpp",
2822 "tools/llvm-cxxfilt/*.h",
2827 ":CxxfiltOptsTableGen",
2837 "tools/llvm-dis/*.cpp",
2838 "tools/llvm-dis/*.h",
2851 name = "llvm-dwarfdump",
2853 "tools/llvm-dwarfdump/*.cpp",
2854 "tools/llvm-dwarfdump/*.h",
2859 ":AllTargetsCodeGens",
2872 "tools/llvm-dwp/*.cpp",
2873 "tools/llvm-dwp/*.h",
2878 ":AllTargetsCodeGens",
2886 name = "llvm-exegesis",
2888 "tools/llvm-exegesis/llvm-exegesis.cpp",
2890 copts = llvm_copts + ["-DHAVE_LIBPFM=0"],
2891 linkopts = ["-lpfm"],
2894 "manual", # External dependency (libpfm4 through Exegesis)
2895 "nobuildkite", # TODO(chandlerc): Enable when the library builds.
2898 ":AllTargetsAsmParsers",
2899 ":AllTargetsCodeGens",
2900 ":AllTargetsDisassemblers",
2911 name = "llvm-extract",
2913 "tools/llvm-extract/*.cpp",
2914 "tools/llvm-extract/*.h",
2932 "tools/llvm-ifs/*.cpp",
2933 "tools/llvm-ifs/*.h",
2946 name = "llvm-jitlink",
2948 "tools/llvm-jitlink/*.cpp",
2949 "tools/llvm-jitlink/*.h",
2952 # Make symbols from the standard library dynamically resolvable.
2954 "@bazel_tools//src/conditions:windows": [],
2955 "@bazel_tools//src/conditions:darwin": [],
2956 "//conditions:default": [
2957 "-Wl,--undefined=_ZTIi",
2958 "-Wl,--export-dynamic-symbol=_ZTIi",
2959 "-Wl,--export-dynamic-symbol=__cxa_begin_catch",
2960 "-Wl,--export-dynamic-symbol=__cxa_end_catch",
2961 "-Wl,--export-dynamic-symbol=__gxx_personality_v0",
2962 "-Wl,--export-dynamic-symbol=__cxa_allocate_exception",
2963 "-Wl,--export-dynamic-symbol=__cxa_throw",
2964 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBWrapper",
2969 ":AllTargetsAsmParsers",
2970 ":AllTargetsCodeGens",
2971 ":AllTargetsDisassemblers",
2985 name = "llvm-libtool-darwin",
2987 "tools/llvm-libtool-darwin/*.cpp",
2988 "tools/llvm-libtool-darwin/*.h",
3002 "tools/llvm-link/*.cpp",
3003 "tools/llvm-link/*.h",
3022 name = "LipoOptsTableGen",
3023 strip_include_prefix = "tools/llvm-lipo",
3025 "-gen-opt-parser-defs",
3026 "tools/llvm-lipo/LipoOpts.inc",
3028 tblgen = ":llvm-tblgen",
3029 td_file = "tools/llvm-lipo/LipoOpts.td",
3030 td_srcs = ["include/llvm/Option/OptParser.td"],
3036 "tools/llvm-lipo/llvm-lipo.cpp",
3041 ":LipoOptsTableGen",
3051 "tools/llvm-lto/*.cpp",
3052 "tools/llvm-lto/*.h",
3057 ":AllTargetsAsmParsers",
3058 ":AllTargetsCodeGens",
3073 "tools/llvm-lto2/*.cpp",
3074 "tools/llvm-lto2/*.h",
3079 ":AllTargetsAsmParsers",
3080 ":AllTargetsCodeGens",
3092 "tools/llvm-mc/*.cpp",
3093 "tools/llvm-mc/*.h",
3098 ":AllTargetsAsmParsers",
3099 ":AllTargetsCodeGens",
3100 ":AllTargetsDisassemblers",
3112 "tools/llvm-mca/*.cpp",
3113 "tools/llvm-mca/*.h",
3114 "tools/llvm-mca/Views/*.cpp",
3115 "tools/llvm-mca/Views/*.h",
3120 ":AllTargetsAsmParsers",
3121 ":AllTargetsCodeGens",
3122 ":AllTargetsDisassemblers",
3128 ":llvm-mca-headers",
3133 name = "MlTableGen",
3134 strip_include_prefix = "tools/llvm-ml",
3136 "-gen-opt-parser-defs",
3137 "tools/llvm-ml/Opts.inc",
3139 tblgen = ":llvm-tblgen",
3140 td_file = "tools/llvm-ml/Opts.td",
3141 td_srcs = ["include/llvm/Option/OptParser.td"],
3147 "tools/llvm-ml/*.cpp",
3148 "tools/llvm-ml/*.h",
3153 ":AllTargetsAsmParsers",
3154 ":AllTargetsCodeGens",
3155 ":AllTargetsDisassemblers",
3165 name = "llvm-modextract",
3167 "tools/llvm-modextract/*.cpp",
3180 name = "MtTableGen",
3181 strip_include_prefix = "tools/llvm-mt",
3183 "-gen-opt-parser-defs",
3184 "tools/llvm-mt/Opts.inc",
3186 tblgen = ":llvm-tblgen",
3187 td_file = "tools/llvm-mt/Opts.td",
3188 td_srcs = ["include/llvm/Option/OptParser.td"],
3194 "tools/llvm-mt/*.cpp",
3195 "tools/llvm-mt/*.h",
3200 "manual", # TODO(gcmn): External dependency (through WindowsManifest)
3201 "nobuildkite", # TODO(gcmn): Re-enable when WindowsManifest builds
3212 name = "NmOptsTableGen",
3213 strip_include_prefix = "tools/llvm-nm",
3215 "-gen-opt-parser-defs",
3216 "tools/llvm-nm/Opts.inc",
3218 tblgen = ":llvm-tblgen",
3219 td_file = "tools/llvm-nm/Opts.td",
3220 td_srcs = ["include/llvm/Option/OptParser.td"],
3226 "tools/llvm-nm/*.cpp",
3227 "tools/llvm-nm/*.h",
3232 ":AllTargetsAsmParsers",
3233 ":AllTargetsCodeGens",
3246 name = "llvm-objcopy-opts",
3247 strip_include_prefix = "tools/llvm-objcopy",
3249 "-gen-opt-parser-defs",
3250 "tools/llvm-objcopy/ObjcopyOpts.inc",
3252 tblgen = ":llvm-tblgen",
3253 td_file = "tools/llvm-objcopy/ObjcopyOpts.td",
3255 "include/llvm/Option/OptParser.td",
3256 "tools/llvm-objcopy/CommonOpts.td",
3261 name = "llvm-installnametool-opts",
3262 strip_include_prefix = "tools/llvm-objcopy",
3264 "-gen-opt-parser-defs",
3265 "tools/llvm-objcopy/InstallNameToolOpts.inc",
3267 tblgen = ":llvm-tblgen",
3268 td_file = "tools/llvm-objcopy/InstallNameToolOpts.td",
3270 "include/llvm/Option/OptParser.td",
3271 "tools/llvm-objcopy/CommonOpts.td",
3276 name = "llvm-strip-opts",
3277 strip_include_prefix = "tools/llvm-objcopy",
3279 "-gen-opt-parser-defs",
3280 "tools/llvm-objcopy/StripOpts.inc",
3282 tblgen = ":llvm-tblgen",
3283 td_file = "tools/llvm-objcopy/StripOpts.td",
3285 "include/llvm/Option/OptParser.td",
3286 "tools/llvm-objcopy/CommonOpts.td",
3291 name = "llvm-bitcode-strip-opts",
3292 strip_include_prefix = "tools/llvm-objcopy",
3294 "-gen-opt-parser-defs",
3295 "tools/llvm-objcopy/BitcodeStripOpts.inc",
3297 tblgen = ":llvm-tblgen",
3298 td_file = "tools/llvm-objcopy/BitcodeStripOpts.td",
3300 "include/llvm/Option/OptParser.td",
3301 "tools/llvm-objcopy/CommonOpts.td",
3306 name = "llvm-stress",
3308 "tools/llvm-stress/*.cpp",
3309 "tools/llvm-stress/*.h",
3320 name = "llvm-objcopy",
3322 "tools/llvm-objcopy/**/*.cpp",
3323 # Note that we redundantly include the headers here to allow files to
3324 # include same-directory headers in addition to including headers via
3325 # the `llvm-objcopy-headers` rule's stripped include prefix.
3326 "tools/llvm-objcopy/**/*.h",
3338 ":llvm-bitcode-strip-opts",
3339 ":llvm-installnametool-opts",
3340 ":llvm-objcopy-headers",
3341 ":llvm-objcopy-opts",
3347 name = "llvm-strip",
3348 binary = ":llvm-objcopy",
3352 name = "llvm-bitcode-strip",
3353 binary = ":llvm-objcopy",
3357 name = "llvm-install-name-tool",
3358 binary = ":llvm-objcopy",
3362 name = "llvm-objdump",
3364 "tools/llvm-objdump/*.cpp",
3365 "tools/llvm-objdump/*.h",
3370 ":AllTargetsAsmParsers",
3371 ":AllTargetsCodeGens",
3372 ":AllTargetsDisassemblers",
3380 ":ObjdumpOptsTableGen",
3383 ":OtoolOptsTableGen",
3391 name = "ObjdumpOptsTableGen",
3392 strip_include_prefix = "tools/llvm-objdump",
3394 "-gen-opt-parser-defs",
3395 "tools/llvm-objdump/ObjdumpOpts.inc",
3397 tblgen = ":llvm-tblgen",
3398 td_file = "tools/llvm-objdump/ObjdumpOpts.td",
3399 td_srcs = ["include/llvm/Option/OptParser.td"],
3403 name = "llvm-otool",
3404 binary = ":llvm-objdump",
3408 name = "OtoolOptsTableGen",
3409 strip_include_prefix = "tools/llvm-objdump",
3411 "-gen-opt-parser-defs",
3412 "tools/llvm-objdump/OtoolOpts.inc",
3414 tblgen = ":llvm-tblgen",
3415 td_file = "tools/llvm-objdump/OtoolOpts.td",
3416 td_srcs = ["include/llvm/Option/OptParser.td"],
3420 name = "llvm-opt-report",
3422 "tools/llvm-opt-report/*.cpp",
3427 ":AllTargetsCodeGens",
3435 name = "llvm-pdbutil",
3437 "tools/llvm-pdbutil/*.cpp",
3438 "tools/llvm-pdbutil/*.h",
3444 ":DebugInfoCodeView",
3455 name = "llvm-profdata",
3457 "tools/llvm-profdata/*.cpp",
3458 "tools/llvm-profdata/*.h",
3470 name = "llvm-profgen",
3472 "tools/llvm-profgen/*.cpp",
3473 "tools/llvm-profgen/*.h",
3478 ":AllTargetsCodeGens",
3479 ":AllTargetsDisassemblers",
3485 name = "RcTableGen",
3486 strip_include_prefix = "tools/llvm-rc",
3488 "-gen-opt-parser-defs",
3489 "tools/llvm-rc/Opts.inc",
3491 tblgen = ":llvm-tblgen",
3492 td_file = "tools/llvm-rc/Opts.td",
3493 td_srcs = ["include/llvm/Option/OptParser.td"],
3497 name = "WindresTableGen",
3498 strip_include_prefix = "tools/llvm-rc",
3500 "-gen-opt-parser-defs",
3501 "tools/llvm-rc/WindresOpts.inc",
3503 tblgen = ":llvm-tblgen",
3504 td_file = "tools/llvm-rc/WindresOpts.td",
3505 td_srcs = ["include/llvm/Option/OptParser.td"],
3508 # Workaround inability to put `.def` files into `srcs` with a library.
3510 name = "llvm-rc-defs-lib",
3511 textual_hdrs = glob(["tools/llvm-rc/*.def"]),
3517 "tools/llvm-rc/*.cpp",
3518 "tools/llvm-rc/*.h",
3528 ":llvm-rc-defs-lib",
3533 name = "llvm-windres",
3534 binary = ":llvm-rc",
3538 name = "ReadobjOptsTableGen",
3539 strip_include_prefix = "tools/llvm-readobj",
3541 "-gen-opt-parser-defs",
3542 "tools/llvm-readobj/Opts.inc",
3544 tblgen = ":llvm-tblgen",
3545 td_file = "tools/llvm-readobj/Opts.td",
3546 td_srcs = ["include/llvm/Option/OptParser.td"],
3550 name = "llvm-readobj",
3552 "tools/llvm-readobj/*.cpp",
3553 "tools/llvm-readobj/*.h",
3558 ":AllTargetsCodeGens",
3561 ":DebugInfoCodeView",
3566 ":ReadobjOptsTableGen",
3571 # Create an 'llvm-readelf' named binary from the 'llvm-readobj' tool.
3573 name = "llvm-readelf",
3574 binary = ":llvm-readobj",
3578 name = "llvm-reduce",
3580 "tools/llvm-reduce/**/*.cpp",
3581 "tools/llvm-reduce/**/*.h",
3584 includes = ["tools/llvm-reduce"],
3587 ":AllTargetsAsmParsers",
3588 ":AllTargetsCodeGens",
3595 name = "llvm-rtdyld",
3597 "tools/llvm-rtdyld/*.cpp",
3598 "tools/llvm-rtdyld/*.h",
3603 ":AllTargetsCodeGens",
3604 ":AllTargetsDisassemblers",
3616 name = "SizeOptsTableGen",
3617 strip_include_prefix = "tools/llvm-size",
3619 "-gen-opt-parser-defs",
3620 "tools/llvm-size/Opts.inc",
3622 tblgen = ":llvm-tblgen",
3623 td_file = "tools/llvm-size/Opts.td",
3624 td_srcs = ["include/llvm/Option/OptParser.td"],
3630 "tools/llvm-size/*.cpp",
3631 "tools/llvm-size/*.h",
3638 ":SizeOptsTableGen",
3644 name = "llvm-split",
3646 "tools/llvm-split/*.cpp",
3647 "tools/llvm-split/*.h",
3661 name = "StringsOptsTableGen",
3662 strip_include_prefix = "tools/llvm-strings",
3664 "-gen-opt-parser-defs",
3665 "tools/llvm-strings/Opts.inc",
3667 tblgen = ":llvm-tblgen",
3668 td_file = "tools/llvm-strings/Opts.td",
3669 td_srcs = ["include/llvm/Option/OptParser.td"],
3673 name = "llvm-strings",
3675 "tools/llvm-strings/*.cpp",
3676 "tools/llvm-strings/*.h",
3683 ":StringsOptsTableGen",
3689 name = "SymbolizerOptsTableGen",
3690 strip_include_prefix = "tools/llvm-symbolizer",
3692 "-gen-opt-parser-defs",
3693 "tools/llvm-symbolizer/Opts.inc",
3695 tblgen = ":llvm-tblgen",
3696 td_file = "tools/llvm-symbolizer/Opts.td",
3697 td_srcs = ["include/llvm/Option/OptParser.td"],
3701 name = "llvm-symbolizer",
3703 "tools/llvm-symbolizer/*.cpp",
3704 "tools/llvm-symbolizer/*.h",
3716 ":SymbolizerOptsTableGen",
3721 name = "llvm-addr2line",
3722 binary = ":llvm-symbolizer",
3726 name = "llvm-undname",
3728 "tools/llvm-undname/*.cpp",
3729 "tools/llvm-undname/*.h",
3742 "tools/llvm-xray/*.cpp",
3743 "tools/llvm-xray/*.cc",
3744 "tools/llvm-xray/*.h",
3765 "@bazel_tools//src/conditions:windows": [],
3766 "@bazel_tools//src/conditions:darwin": [],
3767 "//conditions:default": ["-Wl,--export-dynamic"],
3771 ":AllTargetsAsmParsers",
3772 ":AllTargetsCodeGens",
3785 ":common_transforms",
3793 "tools/sancov/*.cpp",
3799 ":AllTargetsCodeGens",
3800 ":AllTargetsDisassemblers",
3814 "tools/sanstats/*.cpp",
3815 "tools/sanstats/*.h",
3827 name = "split-file",
3829 "tools/split-file/*.cpp",
3830 "tools/split-file/*.h",
3839 ################################################################################
3840 # Begin testonly libraries
3843 name = "FuzzMutate",
3845 srcs = glob(["lib/FuzzMutate/*.cpp"]),
3846 hdrs = glob(["include/llvm/FuzzMutate/*.h"]),
3848 includes = ["include"],
3862 srcs = glob(["tools/llvm-diff/lib/*.cpp"]),
3863 hdrs = glob(["tools/llvm-diff/lib/*.h"]),
3870 # A hacky library to expose some internal headers of gtest to its own
3871 # implementation source files using a stripped include prefix rather than
3872 # file-relative-inclusion.
3874 # FIXME: This file should be in `textual_hdrs` instead of `hdrs`, but
3875 # unfortunately that doesn't work with `strip_include_prefix`:
3876 # https://github.com/bazelbuild/bazel/issues/12424
3878 # For now, simply disable parsing and header modules.
3880 name = "gtest_internal_headers",
3882 hdrs = ["utils/unittest/googletest/src/gtest-internal-inl.h"],
3887 strip_include_prefix = "utils/unittest/googletest",
3895 "utils/unittest/googletest/include/**/*.h",
3896 "utils/unittest/googletest/src/*.cc",
3899 "utils/unittest/googletest/src/gtest-all.cc",
3900 "utils/unittest/googletest/include/gtest/gtest_pred_impl.h",
3904 hdrs = ["utils/unittest/googletest/include/gtest/gtest.h"],
3908 "__STDC_LIMIT_MACROS",
3909 "__STDC_CONSTANT_MACROS",
3911 "@bazel_tools//src/conditions:windows": ["GTEST_USE_OWN_TR1_TUPLE=0"],
3912 "//conditions:default": ["GTEST_USE_OWN_TR1_TUPLE=1"],
3916 "utils/unittest/googletest/include",
3919 "utils/unittest/googletest/include/gtest/gtest_pred_impl.h",
3923 ":gtest_internal_headers",
3928 name = "gtest_main",
3930 srcs = ["utils/unittest/UnitTestMain/TestMain.cpp"],
3944 "utils/unittest/googlemock/include/**/*.h",
3945 "utils/unittest/googlemock/src/*.cc",
3947 exclude = ["utils/unittest/googlemock/src/gmock-all.cc"],
3950 "utils/unittest/googlemock/include/gmock/gmock.h",
3951 "utils/unittest/googlemock/include/gmock/gmock-matchers.h",
3956 "utils/unittest/googlemock/include",
3964 srcs = ["utils/lit/lit.py"] + glob(["utils/lit/lit/**/*.py"]),
3968 name = "TestingSupport",
3971 "lib/Testing/Support/*.cpp",
3972 "lib/Testing/Support/*.h",
3975 "include/llvm/Testing/Support/*.h",
3986 ################################################################################
3987 # Begin testonly binary utilities
3993 "utils/FileCheck/*.cpp",
3994 "utils/FileCheck/*.h",
3998 deps = [":FileCheckLib"],
4004 "tools/bugpoint/*.cpp",
4005 "tools/bugpoint/*.h",
4010 ":AllTargetsAsmParsers",
4011 ":AllTargetsCodeGens",
4023 ":common_transforms",
4039 name = "lli-child-target",
4042 "tools/lli/ChildTarget/*.cpp",
4043 "tools/lli/ChildTarget/*.h",
4046 # The tests load code into this binary that expect to see symbols
4047 # from libstdc++ such as __cxa_begin_catch and _ZTIi. The latter
4048 # isn't even used in the main binary, so we also need to force it
4051 "@bazel_tools//src/conditions:windows": [],
4052 "@bazel_tools//src/conditions:darwin": [],
4053 "//conditions:default": [
4064 ":intrinsic_enums_gen",
4069 name = "llvm-c-test",
4072 "tools/llvm-c-test/*.c",
4073 "tools/llvm-c-test/*.cpp",
4074 "tools/llvm-c-test/*.h",
4078 ":AllTargetsAsmParsers",
4079 ":AllTargetsCodeGens",
4080 ":AllTargetsDisassemblers",
4103 "tools/llvm-diff/*.cpp",
4104 "tools/llvm-diff/*.h",
4117 name = "llvm-isel-fuzzer",
4120 "tools/llvm-isel-fuzzer/*.cpp",
4121 "tools/llvm-isel-fuzzer/*.h",
4126 ":AllTargetsAsmParsers",
4127 ":AllTargetsCodeGens",
4140 # This is really a Python script, but call it sh_binary to ignore the hyphen in
4141 # the path, which py_binary does not allow.
4142 # Also, note: llvm-locstats expects llvm-dwarfdump to be in the same directory
4145 name = "llvm-locstats",
4148 "utils/llvm-locstats/*.py",
4150 # llvm-locstats is a thin wrapper around llvm-dwarfdump.
4151 data = [":llvm-dwarfdump"],
4155 name = "llvm-original-di-preservation",
4157 srcs = ["utils/llvm-original-di-preservation.py"],
4169 deps = [":Support"],
4173 name = "llvm-opt-fuzzer",
4176 "tools/llvm-opt-fuzzer/*.cpp",
4181 ":AllTargetsCodeGens",
4195 name = "llvm-tapi-diff",
4198 "tools/llvm-tapi-diff/*.cpp",
4199 "tools/llvm-tapi-diff/*.h",
4211 name = "TLICheckerOptsTableGen",
4212 strip_include_prefix = "tools/llvm-tli-checker",
4214 "-gen-opt-parser-defs",
4215 "tools/llvm-tli-checker/Opts.inc",
4217 tblgen = ":llvm-tblgen",
4218 td_file = "tools/llvm-tli-checker/Opts.td",
4219 td_srcs = ["include/llvm/Option/OptParser.td"],
4223 name = "llvm-tli-checker",
4226 "tools/llvm-tli-checker/*.cpp",
4227 "tools/llvm-tli-checker/*.h",
4245 ":TLICheckerOptsTableGen",
4253 "tools/obj2yaml/*.cpp",
4254 "tools/obj2yaml/*.h",
4260 ":DebugInfoCodeView",
4269 name = "verify-uselistorder",
4271 "tools/verify-uselistorder/*.cpp",
4272 "tools/verify-uselistorder/*.h",
4290 "tools/yaml2obj/*.cpp",
4291 "tools/yaml2obj/*.h",
4297 ":DebugInfoCodeView",
4306 name = "yaml-bench",
4309 "utils/yaml-bench/*.cpp",