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("@bazel_skylib//rules:common_settings.bzl", "string_flag")
6 load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
7 load(":tblgen.bzl", "gentbl")
8 load(":config.bzl", "llvm_config_defines")
9 load(":targets.bzl", "llvm_targets")
10 load(":enum_targets_gen.bzl", "enum_targets_gen")
11 load(":binary_alias.bzl", "binary_alias")
14 default_visibility = ["//visibility:public"],
15 features = ["layering_check"],
22 "cmake/modules/llvm-driver-template.cpp.in",
23 "include/llvm/CodeGen/SDNodeProperties.td",
24 "include/llvm/CodeGen/ValueTypes.td",
25 "include/llvm/Frontend/Directive/DirectiveBase.td",
26 "include/llvm/Frontend/OpenACC/ACC.td",
27 "include/llvm/Frontend/OpenMP/OMP.td",
28 "include/llvm/IR/Intrinsics.td",
29 "include/llvm/Option/OptParser.td",
33 # It may be tempting to add compiler flags here, but that should be avoided.
34 # The necessary warnings and other compile flags should be provided by the
35 # toolchain or the `.bazelrc` file. This is just a workaround until we have a
36 # widely available feature to enable unlimited stack frame instead of using
37 # this `Make` variable.
39 "$(STACK_FRAME_UNLIMITED)",
43 name = "targets_def_gen",
44 src = "include/llvm/Config/Targets.def.in",
45 out = "include/llvm/Config/Targets.def",
46 macro_name = "TARGET",
47 targets = llvm_targets,
50 # Enabled targets with ASM printers.
51 llvm_target_asm_printers = [
54 if glob(["lib/Target/{}/*AsmPrinter.cpp".format(t)])
58 name = "asm_printers_def_gen",
59 src = "include/llvm/Config/AsmPrinters.def.in",
60 out = "include/llvm/Config/AsmPrinters.def",
61 macro_name = "ASM_PRINTER",
62 targets = llvm_target_asm_printers,
65 # Enabled targets with ASM parsers.
66 llvm_target_asm_parsers = [
69 if glob(["lib/Target/{}/AsmParser/CMakeLists.txt".format(t)])
73 name = "asm_parsers_def_gen",
74 src = "include/llvm/Config/AsmParsers.def.in",
75 out = "include/llvm/Config/AsmParsers.def",
76 macro_name = "ASM_PARSER",
77 targets = llvm_target_asm_parsers,
80 # Enabled targets with disassemblers.
81 llvm_target_disassemblers = [
84 if glob(["lib/Target/{}/Disassembler/CMakeLists.txt".format(t)])
88 name = "disassemblers_def_gen",
89 src = "include/llvm/Config/Disassemblers.def.in",
90 out = "include/llvm/Config/Disassemblers.def",
91 macro_name = "DISASSEMBLER",
92 targets = llvm_target_disassemblers,
95 # Enabled targets with MCA.
99 if glob(["lib/Target/{}/MCA/CMakeLists.txt".format(t)])
103 name = "target_mca_def_gen",
104 src = "include/llvm/Config/TargetMCAs.def.in",
105 out = "include/llvm/Config/TargetMCAs.def",
106 macro_name = "TARGETMCA",
107 targets = llvm_target_mcas,
110 # Enabled targets with exegesis.
111 llvm_target_exegesis = [
113 for t in llvm_targets
114 if glob(["tools/llvm-exegesis/lib/{}/CMakeLists.txt".format(t)])
118 name = "target_exegesis_def_gen",
119 src = "include/llvm/Config/TargetExegesis.def.in",
120 out = "include/llvm/Config/TargetExegesis.def",
121 macro_name = "EXEGESIS",
122 placeholder_name = "@LLVM_ENUM_EXEGESIS@",
123 targets = llvm_target_exegesis,
127 name = "abi_breaking_h_gen",
128 out = "include/llvm/Config/abi-breaking.h",
130 # Define to enable checks that alter the LLVM C++ ABI
131 "#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS": "#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0",
133 # Define to enable reverse iteration of unordered llvm containers
134 "#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION": "#define LLVM_ENABLE_REVERSE_ITERATION 0",
136 template = "include/llvm/Config/abi-breaking.h.cmake",
139 # To enable diff testing out of tree
141 "include/llvm/Config/config.h.cmake",
142 "include/llvm/Config/llvm-config.h.cmake",
143 "include/llvm/Config/abi-breaking.h.cmake",
149 "include/llvm/Config/abi-breaking.h",
150 "include/llvm/Config/llvm-config.h",
153 defines = llvm_config_defines,
154 includes = ["include"],
156 "include/llvm/Config/AsmParsers.def",
157 "include/llvm/Config/AsmPrinters.def",
158 "include/llvm/Config/Disassemblers.def",
159 "include/llvm/Config/Targets.def",
160 "include/llvm/Config/TargetExegesis.def",
161 "include/llvm/Config/TargetMCAs.def",
162 # Needed for include scanner to find execinfo.h
163 "include/llvm/Config/config.h",
170 "lib/Demangle/*.cpp",
174 "include/llvm/Demangle/*.h",
175 "include/llvm/Demangle/*.def",
182 name = "generate_vcs_revision",
183 outs = ["include/llvm/Support/VCSRevision.h"],
184 cmd = "echo '#undef LLVM_REVISION' >> $@\n" +
185 "echo '#undef LLVM_REPOSITORY' >> $@\n",
189 name = "generate_static_extension_registry",
190 outs = ["include/llvm/Support/Extension.def"],
191 cmd = "echo -e '// extension handlers' >> $@\n" +
192 "echo -e '#undef HANDLE_EXTENSION' >> $@\n",
202 # To avoid a dependency cycle.
203 "include/llvm/Option/*.h",
205 "@platforms//os:windows": glob([
206 "lib/Support/Windows/*.h",
207 "lib/Support/Windows/*.inc",
209 "//conditions:default": glob([
210 "lib/Support/Unix/*.h",
211 "lib/Support/Unix/*.inc",
214 "lib/Support/BLAKE3/blake3.c",
215 "lib/Support/BLAKE3/blake3_dispatch.c",
216 "lib/Support/BLAKE3/blake3_impl.h",
217 "lib/Support/BLAKE3/blake3_portable.c",
218 "lib/Support/BLAKE3/llvm_blake3_prefix.h",
220 "@platforms//cpu:aarch64": [
221 "lib/Support/BLAKE3/blake3_neon.c",
223 "@platforms//cpu:x86_64": [
224 "lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S",
225 "lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S",
226 "lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S",
227 "lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S",
229 "//conditions:default": [
233 "include/llvm/Support/**/*.h",
234 "include/llvm/ADT/*.h",
236 "include/llvm-c/Core.h",
237 "include/llvm-c/DataTypes.h",
238 "include/llvm-c/Deprecated.h",
239 "include/llvm-c/DisassemblerTypes.h",
240 "include/llvm-c/Error.h",
241 "include/llvm-c/ErrorHandling.h",
242 "include/llvm-c/ExternC.h",
243 "include/llvm-c/Support.h",
244 "include/llvm-c/Types.h",
245 "include/llvm-c/blake3.h",
246 "include/llvm/ExecutionEngine/JITSymbol.h",
247 "include/llvm/Support/Extension.def",
248 "include/llvm/Support/VCSRevision.h",
252 "@platforms//cpu:aarch64": [
254 "//conditions:default": [
258 "@platforms//cpu:x86_64": [
260 "//conditions:default": [
267 includes = ["include"],
269 "@platforms//os:windows": [],
270 "@platforms//os:freebsd": [
276 "//conditions:default": [
282 textual_hdrs = glob([
283 "include/llvm/Support/*.def",
288 # We unconditionally depend on the custom LLVM zlib wrapper. This will
289 # be an empty library unless zlib is enabled, in which case it will
290 # both provide the necessary dependencies and configuration defines.
292 # We unconditionally depend on the custom LLVM zstd wrapper. This will
293 # be an empty library unless zstd is enabled, in which case it will
294 # both provide the necessary dependencies and configuration defines.
299 # Note: although FileCheck (the binary) is a test utility, some non-test
300 # targets depend on the FileCheck library target.
302 name = "FileCheckLib",
304 "lib/FileCheck/*.cpp",
307 hdrs = glob(["include/llvm/FileCheck/*.h"]),
315 "lib/LineEditor/*.cpp",
316 "lib/LineEditor/*.h",
318 hdrs = glob(["include/llvm/LineEditor/*.h"]),
332 hdrs = glob(["include/llvm/Option/*.h"]),
343 "lib/TableGen/*.cpp",
346 hdrs = glob(["include/llvm/TableGen/*.h"]),
354 # This exists to avoid circular dependencies.
360 "include/llvm/IR/*.h",
363 "include/llvm/LinkAllPasses.h",
366 "include/llvm-c/Comdat.h",
367 "include/llvm-c/DebugInfo.h",
368 "include/llvm/IR/Value.def",
374 name = "BinaryFormat",
376 "lib/BinaryFormat/*.cpp",
377 "lib/BinaryFormat/*.def",
378 "lib/BinaryFormat/*.h",
381 "include/llvm/BinaryFormat/*.h",
384 includes = ["include"],
385 textual_hdrs = glob([
386 "include/llvm/BinaryFormat/*.def",
387 "include/llvm/BinaryFormat/ELFRelocs/*.def",
397 hdrs = glob(["include/llvm/DebugInfo/**/*.h"]),
399 textual_hdrs = glob(["include/llvm/DebugInfo/**/*.def"]),
407 name = "DebugInfoMSF",
409 "lib/DebugInfo/MSF/*.cpp",
410 "lib/DebugInfo/MSF/*.h",
412 hdrs = glob(["include/llvm/DebugInfo/MSF/*.h"]),
418 name = "DebugInfoBTF",
420 "lib/DebugInfo/BTF/*.cpp",
421 "lib/DebugInfo/BTF/*.h",
423 hdrs = glob(["include/llvm/DebugInfo/BTF/*.h"]) + [
424 "include/llvm/DebugInfo/BTF/BTF.def",
435 name = "DebugInfoCodeView",
437 "lib/DebugInfo/CodeView/*.cpp",
438 "lib/DebugInfo/CodeView/*.h",
441 "include/llvm/DebugInfo/CodeView/*.h",
444 textual_hdrs = glob([
445 "include/llvm/DebugInfo/CodeView/*.def",
455 name = "DebugInfoLogicalView",
457 "lib/DebugInfo/LogicalView/**/*.cpp",
460 "include/llvm/DebugInfo/LogicalView/**/*.h",
466 ":DebugInfoCodeView",
478 name = "DebugInfoPDB",
480 "lib/DebugInfo/PDB/*.cpp",
481 "lib/DebugInfo/PDB/*.h",
482 "lib/DebugInfo/PDB/Native/*.cpp",
483 "lib/DebugInfo/PDB/Native/*.h",
486 "include/llvm/DebugInfo/PDB/*.h",
487 "include/llvm/DebugInfo/PDB/Native/*.h",
494 ":DebugInfoCodeView",
505 "lib/Debuginfod/*.cpp",
508 "include/llvm/Debuginfod/*.h",
527 "include/llvm/MC/*.h",
528 "include/llvm/MC/*.def",
529 "include/llvm/MC/*.inc",
534 ":DebugInfoCodeView",
543 name = "DebugInfoDWARF",
545 "lib/DebugInfo/DWARF/*.cpp",
546 "lib/DebugInfo/DWARF/*.h",
548 hdrs = glob(["include/llvm/DebugInfo/DWARF/*.h"]),
561 name = "DebugInfoGSYM",
563 "lib/DebugInfo/GSYM/*.cpp",
564 "lib/DebugInfo/GSYM/*.h",
566 hdrs = glob(["include/llvm/DebugInfo/GSYM/*.h"]),
580 "lib/DebugInfo/Symbolize/*.cpp",
581 "lib/DebugInfo/Symbolize/*.h",
584 "include/llvm/DebugInfo/Symbolize/*.h",
585 "include/llvm/Debuginfod/*.h",
601 name = "llvm-min-tblgen",
603 "utils/TableGen/Attributes.cpp",
604 "utils/TableGen/CodeGenIntrinsics.cpp",
605 "utils/TableGen/CodeGenIntrinsics.h",
606 "utils/TableGen/DirectiveEmitter.cpp",
607 "utils/TableGen/IntrinsicEmitter.cpp",
608 "utils/TableGen/RISCVTargetDefEmitter.cpp",
609 "utils/TableGen/SDNodeProperties.cpp",
610 "utils/TableGen/SDNodeProperties.h",
611 "utils/TableGen/SequenceToOffsetTable.h",
612 "utils/TableGen/TableGen.cpp",
613 "utils/TableGen/VTEmitter.cpp",
625 name = "TableGenGlobalISel",
627 "utils/TableGen/GlobalISel/*.cpp",
629 "utils/TableGen/CodeGenInstruction.h",
632 # We have to include these headers here as well as in the `hdrs` below
633 # to allow the `.cpp` files to use file-relative-inclusion to find
634 # them, even though consumers of this library use inclusion relative to
635 # `utils/TableGen` with the `strip_includes_prefix` of this library.
636 # This mixture appears to be incompatible with header modules.
637 "utils/TableGen/GlobalISel/*.h",
640 features = ["-header_modules"],
641 strip_include_prefix = "utils/TableGen",
651 name = "llvm-tblgen-headers",
652 textual_hdrs = glob(["utils/TableGen/*.def"]),
656 name = "llvm-tblgen",
658 "utils/TableGen/*.cpp",
659 "utils/TableGen/*.inc",
660 "utils/TableGen/*.h",
662 # Some tablegen sources include headers from MC, so these have to be
663 # listed here. MC uses headers produced by tablegen, so it cannot be a
664 # regular dependency.
665 "include/llvm/MC/*.h",
666 "include/llvm/TargetParser/SubtargetFeature.h",
674 ":TableGenGlobalISel",
677 ":llvm-tblgen-headers",
682 name = "intrinsic_enums_gen",
683 tbl_outs = [("-gen-intrinsic-enums", "include/llvm/IR/IntrinsicEnums.inc")],
684 tblgen = ":llvm-min-tblgen",
685 td_file = "include/llvm/IR/Intrinsics.td",
687 "include/llvm/CodeGen/*.td",
688 "include/llvm/IR/Intrinsics*.td",
693 name = "intrinsics_impl_gen",
694 tbl_outs = [("-gen-intrinsic-impl", "include/llvm/IR/IntrinsicImpl.inc")],
695 tblgen = ":llvm-min-tblgen",
696 td_file = "include/llvm/IR/Intrinsics.td",
698 "include/llvm/CodeGen/*.td",
699 "include/llvm/IR/Intrinsics*.td",
705 tbl_outs = [("-gen-vt", "include/llvm/CodeGen/GenVT.inc")],
706 tblgen = ":llvm-min-tblgen",
707 td_file = "include/llvm/CodeGen/ValueTypes.td",
709 "include/llvm/CodeGen/ValueTypes.td",
713 # Note that the intrinsics are not currently set up so they can be pruned for
715 llvm_target_intrinsics_list = [
718 "intrinsic_prefix": "aarch64",
722 "intrinsic_prefix": "amdgcn",
726 "intrinsic_prefix": "arm",
730 "intrinsic_prefix": "bpf",
734 "intrinsic_prefix": "dx",
738 "intrinsic_prefix": "hexagon",
742 "intrinsic_prefix": "loongarch",
746 "intrinsic_prefix": "mips",
750 "intrinsic_prefix": "nvvm",
754 "intrinsic_prefix": "ppc",
758 "intrinsic_prefix": "r600",
762 "intrinsic_prefix": "riscv",
766 "intrinsic_prefix": "s390",
770 "intrinsic_prefix": "ve",
773 "name": "WebAssembly",
774 "intrinsic_prefix": "wasm",
778 "intrinsic_prefix": "x86",
782 "intrinsic_prefix": "xcore",
788 name = "intrinsic_" + target["name"] + "_gen",
790 "-gen-intrinsic-enums -intrinsic-prefix=" + target["intrinsic_prefix"],
791 "include/llvm/IR/Intrinsics" + target["name"] + ".h",
793 tblgen = ":llvm-min-tblgen",
794 td_file = "include/llvm/IR/Intrinsics.td",
796 "include/llvm/CodeGen/*.td",
797 "include/llvm/IR/*.td",
800 ] for target in llvm_target_intrinsics_list]
803 name = "attributes_gen",
804 tbl_outs = [("-gen-attrs", "include/llvm/IR/Attributes.inc")],
805 tblgen = ":llvm-min-tblgen",
806 td_file = "include/llvm/IR/Attributes.td",
807 td_srcs = ["include/llvm/IR/Attributes.td"],
811 name = "BitstreamReader",
813 "lib/Bitstream/Reader/*.cpp",
814 "lib/Bitstream/Reader/*.h",
817 "include/llvm/Bitstream/BitCodeEnums.h",
818 "include/llvm/Bitstream/BitCodes.h",
819 "include/llvm/Bitstream/BitstreamReader.h",
828 name = "BitstreamWriter",
830 "lib/Bitstream/Writer/*.h",
833 "include/llvm/Bitstream/BitCodeEnums.h",
834 "include/llvm/Bitstream/BitCodes.h",
835 "include/llvm/Bitstream/BitstreamWriter.h",
850 exclude = ["lib/Remarks/RemarkLinker.cpp"],
854 "include/llvm/Remarks/*.h",
856 exclude = ["include/llvm/Remarks/RemarkLinker.h"],
858 "include/llvm-c/Remarks.h",
869 name = "remark_linker",
870 srcs = ["lib/Remarks/RemarkLinker.cpp"],
871 hdrs = ["include/llvm/Remarks/RemarkLinker.h"],
881 name = "llvm_intrinsics_headers",
883 "include/llvm/IR/Intrinsics" + target["name"] + ".h"
884 for target in llvm_target_intrinsics_list
897 "include/llvm/IR/*.h",
900 "include/llvm/LinkAllPasses.h",
903 "include/llvm-c/Comdat.h",
904 "include/llvm-c/DebugInfo.h",
905 ] + [":llvm_intrinsics_headers"],
907 textual_hdrs = glob(["include/llvm/IR/*.def"]),
916 ":intrinsic_enums_gen",
917 ":intrinsics_impl_gen",
924 "lib/Bitcode/Reader/*.cpp",
925 "lib/Bitcode/Reader/*.h",
928 "include/llvm-c/BitReader.h",
929 "include/llvm/Bitcode/BitcodeAnalyzer.h",
930 "include/llvm/Bitcode/BitcodeCommon.h",
931 "include/llvm/Bitcode/BitcodeReader.h",
932 "include/llvm/Bitcode/LLVMBitCodes.h",
948 "lib/MC/MCParser/*.cpp",
949 "lib/MC/MCParser/*.h",
951 hdrs = glob(["include/llvm/MC/MCParser/*.h"]),
955 ":DebugInfoCodeView",
966 "lib/TextAPI/**/*.cpp",
969 "include/llvm/TextAPI/**/*.h",
970 "include/llvm/TextAPI/**/*.def",
971 "lib/TextAPI/**/*.h",
984 "lib/ObjCopy/**/*.cpp",
985 "lib/ObjCopy/**/*.h",
988 "include/llvm/ObjCopy/**/*.h",
991 includes = ["lib/ObjCopy"],
1000 ":intrinsics_impl_gen",
1011 "include/llvm/Object/*.h",
1013 "include/llvm-c/Object.h",
1031 name = "ObjectYAML",
1033 "lib/ObjectYAML/*.cpp",
1034 "lib/ObjectYAML/*.h",
1036 hdrs = glob(["include/llvm/ObjectYAML/*.h"]),
1040 ":DebugInfoCodeView",
1049 name = "ProfileData",
1051 "lib/ProfileData/*.cpp",
1052 "lib/ProfileData/*.h",
1055 "include/llvm/ProfileData/*.h",
1056 "include/llvm/ProfileData/*.inc",
1075 "lib/ProfileData/Coverage/*.cpp",
1076 "lib/ProfileData/Coverage/*.h",
1078 hdrs = glob(["include/llvm/ProfileData/Coverage/*.h"]),
1092 "lib/Analysis/*.cpp",
1094 "lib/Analysis/*.def",
1099 "include/llvm/Analysis/*.h",
1100 "include/llvm/Analysis/Utils/*.h",
1103 "include/llvm-c/Analysis.h",
1106 textual_hdrs = glob([
1107 "include/llvm/Analysis/*.def",
1123 "lib/Bitcode/Writer/*.cpp",
1124 "lib/Bitcode/Writer/*.h",
1127 "include/llvm-c/BitWriter.h",
1128 "include/llvm/Bitcode/BitcodeCommon.h",
1129 "include/llvm/Bitcode/BitcodeConvenience.h",
1130 "include/llvm/Bitcode/BitcodeWriter.h",
1131 "include/llvm/Bitcode/BitcodeWriterPass.h",
1132 "include/llvm/Bitcode/LLVMBitCodes.h",
1155 "include/llvm/Target/*.h",
1157 "include/llvm-c/Target.h",
1158 "include/llvm-c/TargetMachine.h",
1173 name = "RISCVTargetParserDefGen",
1174 tbl_outs = [("-gen-riscv-target-def", "include/llvm/TargetParser/RISCVTargetParserDef.inc")],
1175 tblgen = ":llvm-min-tblgen",
1176 td_file = "lib/Target/RISCV/RISCV.td",
1178 ":common_target_td_sources",
1180 "lib/Target/RISCV/**/*.td",
1185 name = "TargetParser",
1187 "lib/TargetParser/*.cpp",
1188 "lib/TargetParser/*.h",
1190 "@platforms//os:windows": glob([
1191 "lib/TargetParser/Windows/*.h",
1192 "lib/TargetParser/Windows/*.inc",
1194 "//conditions:default": glob([
1195 "lib/TargetParser/Unix/*.h",
1196 "lib/TargetParser/Unix/*.inc",
1200 "include/llvm/TargetParser/*.h",
1203 includes = ["include"],
1205 "include/llvm/TargetParser/RISCVTargetParserDef.inc",
1207 "include/llvm/TargetParser/*.def",
1221 hdrs = glob(["include/llvm/DWP/*.h"]),
1233 name = "TransformUtils",
1235 "lib/Transforms/Utils/*.cpp",
1236 "lib/Transforms/Utils/*.h",
1238 hdrs = glob(["include/llvm/Transforms/Utils/*.h"]) + [
1239 "include/llvm/Transforms/Utils.h",
1256 name = "InstCombineTableGen",
1257 strip_include_prefix = "lib/Target/AMDGPU",
1259 "-gen-searchable-tables",
1260 "lib/Target/AMDGPU/InstCombineTables.inc",
1262 tblgen = ":llvm-tblgen",
1263 td_file = "lib/Target/AMDGPU/InstCombineTables.td",
1265 "include/llvm/CodeGen/*.td",
1266 "include/llvm/IR/Intrinsics*.td",
1268 "lib/Target/AMDGPU/InstCombineTables.td",
1269 "include/llvm/TableGen/SearchableTable.td",
1274 name = "InstCombine",
1276 "lib/Transforms/InstCombine/*.cpp",
1277 "lib/Transforms/InstCombine/*.h",
1279 hdrs = glob(["include/llvm/Transforms/InstCombine/*.h"]),
1292 name = "AggressiveInstCombine",
1294 "lib/Transforms/AggressiveInstCombine/*.cpp",
1295 "lib/Transforms/AggressiveInstCombine/*.h",
1298 "include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h",
1310 name = "Instrumentation",
1312 "lib/Transforms/Instrumentation/*.cpp",
1313 "lib/Transforms/Instrumentation/*.h",
1314 "lib/Transforms/Instrumentation/*.inc",
1316 hdrs = glob(["include/llvm/Transforms/Instrumentation/*.h"]) + [
1317 "include/llvm/Transforms/Instrumentation.h",
1338 "lib/Transforms/ObjCARC/*.cpp",
1339 "lib/Transforms/ObjCARC/*.h",
1341 hdrs = ["include/llvm/Transforms/ObjCARC.h"],
1356 "lib/Transforms/Scalar/*.cpp",
1357 "lib/Transforms/Scalar/*.h",
1359 hdrs = glob(["include/llvm/Transforms/Scalar/*.h"]) + [
1360 "include/llvm/Transforms/Scalar.h",
1364 ":AggressiveInstCombine",
1380 "lib/Transforms/Vectorize/*.cpp",
1381 "lib/Transforms/Vectorize/*.h",
1384 "include/llvm/Transforms/Vectorize/*.h",
1386 "include/llvm/Transforms/Vectorize.h",
1400 name = "FrontendDebug",
1402 "lib/Frontend/Debug/*.cpp",
1405 "include/llvm/Frontend/Debug/*.h",
1414 name = "FrontendHLSL",
1416 "lib/Frontend/HLSL/*.cpp",
1419 "include/llvm/Frontend/HLSL/*.h",
1429 name = "FrontendOffloading",
1431 "lib/Frontend/Offloading/*.cpp",
1434 "include/llvm/Frontend/Offloading/*.h",
1446 name = "omp_td_files",
1448 "include/llvm/Frontend/OpenMP/*.td",
1449 "include/llvm/Frontend/Directive/*.td",
1457 ("--gen-directive-decl", "include/llvm/Frontend/OpenMP/OMP.h.inc"),
1459 tblgen = ":llvm-min-tblgen",
1460 td_file = "include/llvm/Frontend/OpenMP/OMP.td",
1461 td_srcs = [":omp_td_files"],
1465 name = "omp_gen_impl",
1468 ("--gen-directive-impl", "include/llvm/Frontend/OpenMP/OMP.inc"),
1470 tblgen = ":llvm-min-tblgen",
1471 td_file = "include/llvm/Frontend/OpenMP/OMP.td",
1472 td_srcs = [":omp_td_files"],
1476 name = "FrontendOpenMP",
1478 "lib/Frontend/OpenMP/*.cpp",
1481 "include/llvm/Frontend/OpenMP/*.h",
1482 "include/llvm/Frontend/OpenMP/OMP/*.h",
1483 "include/llvm/Frontend/*.h",
1485 "include/llvm/Frontend/OpenMP/OMP.h.inc",
1486 "include/llvm/Frontend/OpenMP/OMP.inc",
1489 textual_hdrs = glob([
1490 "include/llvm/Frontend/OpenMP/*.def",
1496 ":FrontendOffloading",
1507 name = "acc_td_files",
1509 "include/llvm/Frontend/OpenACC/*.td",
1510 "include/llvm/Frontend/Directive/*.td",
1518 ("--gen-directive-decl", "include/llvm/Frontend/OpenACC/ACC.h.inc"),
1520 tblgen = ":llvm-min-tblgen",
1521 td_file = "include/llvm/Frontend/OpenACC/ACC.td",
1522 td_srcs = [":acc_td_files"],
1526 name = "acc_gen_impl",
1529 ("--gen-directive-impl", "include/llvm/Frontend/OpenACC/ACC.inc"),
1531 tblgen = ":llvm-min-tblgen",
1532 td_file = "include/llvm/Frontend/OpenACC/ACC.td",
1533 td_srcs = [":acc_td_files"],
1537 name = "FrontendOpenACC",
1539 "lib/Frontend/OpenACC/*.cpp",
1541 "include/llvm/Frontend/OpenACC/ACC.inc",
1544 "include/llvm/Frontend/OpenACC/*.h",
1545 ]) + ["include/llvm/Frontend/OpenACC/ACC.h.inc"],
1558 "lib/AsmParser/*.cpp",
1559 "lib/AsmParser/*.h",
1561 hdrs = glob(["include/llvm/AsmParser/*.h"]),
1574 "lib/IRPrinter/*.cpp",
1575 "lib/IRPrinter/*.h",
1578 "include/llvm/IRPrinter/*.h",
1591 "lib/IRReader/*.cpp",
1595 "include/llvm/IRReader/*.h",
1597 "include/llvm-c/IRReader.h",
1616 "include/llvm/Linker/*.h",
1618 "include/llvm-c/Linker.h",
1634 "lib/Transforms/IPO/*.cpp",
1635 "lib/Transforms/IPO/*.h",
1638 "include/llvm/Transforms/IPO/*.h",
1640 "include/llvm/Transforms/IPO.h",
1644 ":AggressiveInstCombine",
1672 "lib/Transforms/CFGuard/*.cpp",
1673 "lib/Transforms/CFGuard/*.h",
1675 hdrs = ["include/llvm/Transforms/CFGuard.h"],
1687 "lib/Transforms/HipStdPar/*.cpp",
1688 "lib/Transforms/HipStdPar/*.h",
1690 hdrs = ["include/llvm/Transforms/HipStdPar/HipStdPar.h"],
1702 name = "Coroutines",
1704 "lib/Transforms/Coroutines/*.cpp",
1705 "lib/Transforms/Coroutines/*.h",
1707 hdrs = glob(["include/llvm/Transforms/Coroutines/*.h"]),
1721 # Meta-target for clients which depend on all of the transforms libraries.
1723 name = "common_transforms",
1725 ":AggressiveInstCombine",
1738 name = "asm_printer_defs",
1740 textual_hdrs = glob(["lib/CodeGen/AsmPrinter/*.def"]),
1744 name = "CodeGenTypes",
1746 "lib/CodeGen/LowLevelType.cpp",
1749 "include/llvm/CodeGen/LowLevelType.h",
1750 "include/llvm/CodeGen/MachineValueType.h",
1763 "lib/CodeGen/**/*.cpp",
1764 "lib/CodeGen/**/*.h",
1765 "lib/CodeGen/SelectionDAG/*.cpp",
1766 "lib/CodeGen/SelectionDAG/*.h",
1769 "lib/CodeGen/LowLevelType.cpp",
1773 "include/llvm/LinkAllPasses.h",
1776 "include/llvm/CodeGen/**/*.h",
1780 textual_hdrs = glob([
1781 "include/llvm/CodeGen/**/*.def",
1782 "include/llvm/CodeGen/**/*.inc",
1785 ":AggressiveInstCombine",
1793 ":DebugInfoCodeView",
1808 ":asm_printer_defs",
1815 name = "MCDisassembler",
1817 "lib/MC/MCDisassembler/*.cpp",
1818 "lib/MC/MCDisassembler/*.h",
1821 "include/llvm/MC/MCDisassembler/*.h",
1823 "include/llvm-c/Disassembler.h",
1835 llvm_target_lib_list = [lib for lib in [
1838 "short_name": "AArch64",
1840 ("-gen-register-bank", "lib/Target/AArch64/AArch64GenRegisterBank.inc"),
1841 ("-gen-register-info", "lib/Target/AArch64/AArch64GenRegisterInfo.inc"),
1842 ("-gen-instr-info", "lib/Target/AArch64/AArch64GenInstrInfo.inc"),
1843 ("-gen-emitter", "lib/Target/AArch64/AArch64GenMCCodeEmitter.inc"),
1844 ("-gen-pseudo-lowering", "lib/Target/AArch64/AArch64GenMCPseudoLowering.inc"),
1845 ("-gen-asm-writer", "lib/Target/AArch64/AArch64GenAsmWriter.inc"),
1846 ("-gen-asm-writer -asmwriternum=1", "lib/Target/AArch64/AArch64GenAsmWriter1.inc"),
1847 ("-gen-asm-matcher", "lib/Target/AArch64/AArch64GenAsmMatcher.inc"),
1848 ("-gen-dag-isel", "lib/Target/AArch64/AArch64GenDAGISel.inc"),
1849 ("-gen-fast-isel", "lib/Target/AArch64/AArch64GenFastISel.inc"),
1850 ("-gen-global-isel", "lib/Target/AArch64/AArch64GenGlobalISel.inc"),
1851 ("-gen-global-isel-combiner -combiners=AArch64O0PreLegalizerCombiner", "lib/Target/AArch64/AArch64GenO0PreLegalizeGICombiner.inc"),
1852 ("-gen-global-isel-combiner -combiners=AArch64PreLegalizerCombiner", "lib/Target/AArch64/AArch64GenPreLegalizeGICombiner.inc"),
1853 ("-gen-global-isel-combiner -combiners=AArch64PostLegalizerCombiner", "lib/Target/AArch64/AArch64GenPostLegalizeGICombiner.inc"),
1854 ("-gen-global-isel-combiner -combiners=AArch64PostLegalizerLowering", "lib/Target/AArch64/AArch64GenPostLegalizeGILowering.inc"),
1855 ("-gen-callingconv", "lib/Target/AArch64/AArch64GenCallingConv.inc"),
1856 ("-gen-subtarget", "lib/Target/AArch64/AArch64GenSubtargetInfo.inc"),
1857 ("-gen-disassembler", "lib/Target/AArch64/AArch64GenDisassemblerTables.inc"),
1858 ("-gen-searchable-tables", "lib/Target/AArch64/AArch64GenSystemOperands.inc"),
1859 ("-gen-exegesis", "lib/Target/AArch64/AArch64GenExegesis.inc"),
1864 "short_name": "ARM",
1866 ("-gen-register-bank", "lib/Target/ARM/ARMGenRegisterBank.inc"),
1867 ("-gen-register-info", "lib/Target/ARM/ARMGenRegisterInfo.inc"),
1868 ("-gen-searchable-tables", "lib/Target/ARM/ARMGenSystemRegister.inc"),
1869 ("-gen-instr-info", "lib/Target/ARM/ARMGenInstrInfo.inc"),
1870 ("-gen-emitter", "lib/Target/ARM/ARMGenMCCodeEmitter.inc"),
1871 ("-gen-pseudo-lowering", "lib/Target/ARM/ARMGenMCPseudoLowering.inc"),
1872 ("-gen-asm-writer", "lib/Target/ARM/ARMGenAsmWriter.inc"),
1873 ("-gen-asm-matcher", "lib/Target/ARM/ARMGenAsmMatcher.inc"),
1874 ("-gen-dag-isel", "lib/Target/ARM/ARMGenDAGISel.inc"),
1875 ("-gen-fast-isel", "lib/Target/ARM/ARMGenFastISel.inc"),
1876 ("-gen-global-isel", "lib/Target/ARM/ARMGenGlobalISel.inc"),
1877 ("-gen-callingconv", "lib/Target/ARM/ARMGenCallingConv.inc"),
1878 ("-gen-subtarget", "lib/Target/ARM/ARMGenSubtargetInfo.inc"),
1879 ("-gen-disassembler", "lib/Target/ARM/ARMGenDisassemblerTables.inc"),
1884 "short_name": "AMDGPU",
1886 ("-gen-register-bank", "lib/Target/AMDGPU/AMDGPUGenRegisterBank.inc"),
1887 ("-gen-register-info", "lib/Target/AMDGPU/AMDGPUGenRegisterInfo.inc"),
1888 ("-gen-instr-info", "lib/Target/AMDGPU/AMDGPUGenInstrInfo.inc"),
1889 ("-gen-emitter", "lib/Target/AMDGPU/AMDGPUGenMCCodeEmitter.inc"),
1890 ("-gen-pseudo-lowering", "lib/Target/AMDGPU/AMDGPUGenMCPseudoLowering.inc"),
1891 ("-gen-asm-writer", "lib/Target/AMDGPU/AMDGPUGenAsmWriter.inc"),
1892 ("-gen-asm-matcher", "lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc"),
1893 ("-gen-dag-isel", "lib/Target/AMDGPU/AMDGPUGenDAGISel.inc"),
1894 ("-gen-callingconv", "lib/Target/AMDGPU/AMDGPUGenCallingConv.inc"),
1895 ("-gen-subtarget", "lib/Target/AMDGPU/AMDGPUGenSubtargetInfo.inc"),
1896 ("-gen-disassembler", "lib/Target/AMDGPU/AMDGPUGenDisassemblerTables.inc"),
1897 ("-gen-searchable-tables", "lib/Target/AMDGPU/AMDGPUGenSearchableTables.inc"),
1900 ":InstCombineTableGen",
1901 ":amdgpu_isel_target_gen",
1907 "short_name": "AVR",
1909 ("-gen-asm-matcher", "lib/Target/AVR/AVRGenAsmMatcher.inc"),
1910 ("-gen-asm-writer", "lib/Target/AVR/AVRGenAsmWriter.inc"),
1911 ("-gen-callingconv", "lib/Target/AVR/AVRGenCallingConv.inc"),
1912 ("-gen-dag-isel", "lib/Target/AVR/AVRGenDAGISel.inc"),
1913 ("-gen-disassembler", "lib/Target/AVR/AVRGenDisassemblerTables.inc"),
1914 ("-gen-emitter", "lib/Target/AVR/AVRGenMCCodeEmitter.inc"),
1915 ("-gen-instr-info", "lib/Target/AVR/AVRGenInstrInfo.inc"),
1916 ("-gen-register-info", "lib/Target/AVR/AVRGenRegisterInfo.inc"),
1917 ("-gen-subtarget", "lib/Target/AVR/AVRGenSubtargetInfo.inc"),
1922 "short_name": "BPF",
1924 ("-gen-asm-writer", "lib/Target/BPF/BPFGenAsmWriter.inc"),
1925 ("-gen-asm-matcher", "lib/Target/BPF/BPFGenAsmMatcher.inc"),
1926 ("-gen-callingconv", "lib/Target/BPF/BPFGenCallingConv.inc"),
1927 ("-gen-dag-isel", "lib/Target/BPF/BPFGenDAGISel.inc"),
1928 ("-gen-disassembler", "lib/Target/BPF/BPFGenDisassemblerTables.inc"),
1929 ("-gen-emitter", "lib/Target/BPF/BPFGenMCCodeEmitter.inc"),
1930 ("-gen-instr-info", "lib/Target/BPF/BPFGenInstrInfo.inc"),
1931 ("-gen-register-info", "lib/Target/BPF/BPFGenRegisterInfo.inc"),
1932 ("-gen-subtarget", "lib/Target/BPF/BPFGenSubtargetInfo.inc"),
1937 "short_name": "Hexagon",
1939 ("-gen-asm-matcher", "lib/Target/Hexagon/HexagonGenAsmMatcher.inc"),
1940 ("-gen-asm-writer", "lib/Target/Hexagon/HexagonGenAsmWriter.inc"),
1941 ("-gen-callingconv", "lib/Target/Hexagon/HexagonGenCallingConv.inc"),
1942 ("-gen-dag-isel", "lib/Target/Hexagon/HexagonGenDAGISel.inc"),
1943 ("-gen-dfa-packetizer", "lib/Target/Hexagon/HexagonGenDFAPacketizer.inc"),
1944 ("-gen-disassembler", "lib/Target/Hexagon/HexagonGenDisassemblerTables.inc"),
1945 ("-gen-instr-info", "lib/Target/Hexagon/HexagonGenInstrInfo.inc"),
1946 ("-gen-emitter", "lib/Target/Hexagon/HexagonGenMCCodeEmitter.inc"),
1947 ("-gen-register-info", "lib/Target/Hexagon/HexagonGenRegisterInfo.inc"),
1948 ("-gen-subtarget", "lib/Target/Hexagon/HexagonGenSubtargetInfo.inc"),
1953 "short_name": "Lanai",
1955 ("-gen-asm-matcher", "lib/Target/Lanai/LanaiGenAsmMatcher.inc"),
1956 ("-gen-asm-writer", "lib/Target/Lanai/LanaiGenAsmWriter.inc"),
1957 ("-gen-callingconv", "lib/Target/Lanai/LanaiGenCallingConv.inc"),
1958 ("-gen-dag-isel", "lib/Target/Lanai/LanaiGenDAGISel.inc"),
1959 ("-gen-disassembler", "lib/Target/Lanai/LanaiGenDisassemblerTables.inc"),
1960 ("-gen-emitter", "lib/Target/Lanai/LanaiGenMCCodeEmitter.inc"),
1961 ("-gen-instr-info", "lib/Target/Lanai/LanaiGenInstrInfo.inc"),
1962 ("-gen-register-info", "lib/Target/Lanai/LanaiGenRegisterInfo.inc"),
1963 ("-gen-subtarget", "lib/Target/Lanai/LanaiGenSubtargetInfo.inc"),
1967 "name": "LoongArch",
1968 "short_name": "LoongArch",
1970 ("-gen-asm-matcher", "lib/Target/LoongArch/LoongArchGenAsmMatcher.inc"),
1971 ("-gen-asm-writer", "lib/Target/LoongArch/LoongArchGenAsmWriter.inc"),
1972 ("-gen-dag-isel", "lib/Target/LoongArch/LoongArchGenDAGISel.inc"),
1973 ("-gen-disassembler", "lib/Target/LoongArch/LoongArchGenDisassemblerTables.inc"),
1974 ("-gen-emitter", "lib/Target/LoongArch/LoongArchGenMCCodeEmitter.inc"),
1975 ("-gen-instr-info", "lib/Target/LoongArch/LoongArchGenInstrInfo.inc"),
1976 ("-gen-pseudo-lowering", "lib/Target/LoongArch/LoongArchGenMCPseudoLowering.inc"),
1977 ("-gen-register-info", "lib/Target/LoongArch/LoongArchGenRegisterInfo.inc"),
1978 ("-gen-subtarget", "lib/Target/LoongArch/LoongArchGenSubtargetInfo.inc"),
1983 "short_name": "Mips",
1985 ("-gen-asm-matcher", "lib/Target/Mips/MipsGenAsmMatcher.inc"),
1986 ("-gen-asm-writer", "lib/Target/Mips/MipsGenAsmWriter.inc"),
1987 ("-gen-callingconv", "lib/Target/Mips/MipsGenCallingConv.inc"),
1988 ("-gen-dag-isel", "lib/Target/Mips/MipsGenDAGISel.inc"),
1989 ("-gen-disassembler", "lib/Target/Mips/MipsGenDisassemblerTables.inc"),
1990 ("-gen-emitter", "lib/Target/Mips/MipsGenMCCodeEmitter.inc"),
1991 ("-gen-exegesis", "lib/Target/Mips/MipsGenExegesis.inc"),
1992 ("-gen-fast-isel", "lib/Target/Mips/MipsGenFastISel.inc"),
1993 ("-gen-global-isel", "lib/Target/Mips/MipsGenGlobalISel.inc"),
1994 ("-gen-global-isel-combiner -combiners=MipsPostLegalizerCombiner", "lib/Target/Mips/MipsGenPostLegalizeGICombiner.inc"),
1995 ("-gen-instr-info", "lib/Target/Mips/MipsGenInstrInfo.inc"),
1996 ("-gen-pseudo-lowering", "lib/Target/Mips/MipsGenMCPseudoLowering.inc"),
1997 ("-gen-register-bank", "lib/Target/Mips/MipsGenRegisterBank.inc"),
1998 ("-gen-register-info", "lib/Target/Mips/MipsGenRegisterInfo.inc"),
1999 ("-gen-subtarget", "lib/Target/Mips/MipsGenSubtargetInfo.inc"),
2004 "short_name": "MSP430",
2006 ("-gen-asm-matcher", "lib/Target/MSP430/MSP430GenAsmMatcher.inc"),
2007 ("-gen-asm-writer", "lib/Target/MSP430/MSP430GenAsmWriter.inc"),
2008 ("-gen-callingconv", "lib/Target/MSP430/MSP430GenCallingConv.inc"),
2009 ("-gen-dag-isel", "lib/Target/MSP430/MSP430GenDAGISel.inc"),
2010 ("-gen-disassembler", "lib/Target/MSP430/MSP430GenDisassemblerTables.inc"),
2011 ("-gen-emitter", "lib/Target/MSP430/MSP430GenMCCodeEmitter.inc"),
2012 ("-gen-instr-info", "lib/Target/MSP430/MSP430GenInstrInfo.inc"),
2013 ("-gen-register-info", "lib/Target/MSP430/MSP430GenRegisterInfo.inc"),
2014 ("-gen-subtarget", "lib/Target/MSP430/MSP430GenSubtargetInfo.inc"),
2019 "short_name": "NVPTX",
2021 ("-gen-register-info", "lib/Target/NVPTX/NVPTXGenRegisterInfo.inc"),
2022 ("-gen-instr-info", "lib/Target/NVPTX/NVPTXGenInstrInfo.inc"),
2023 ("-gen-asm-writer", "lib/Target/NVPTX/NVPTXGenAsmWriter.inc"),
2024 ("-gen-dag-isel", "lib/Target/NVPTX/NVPTXGenDAGISel.inc"),
2025 ("-gen-subtarget", "lib/Target/NVPTX/NVPTXGenSubtargetInfo.inc"),
2030 "short_name": "PPC",
2032 ("-gen-asm-writer", "lib/Target/PowerPC/PPCGenAsmWriter.inc"),
2033 ("-gen-asm-matcher", "lib/Target/PowerPC/PPCGenAsmMatcher.inc"),
2034 ("-gen-emitter", "lib/Target/PowerPC/PPCGenMCCodeEmitter.inc"),
2035 ("-gen-register-info", "lib/Target/PowerPC/PPCGenRegisterInfo.inc"),
2036 ("-gen-instr-info", "lib/Target/PowerPC/PPCGenInstrInfo.inc"),
2037 ("-gen-dag-isel", "lib/Target/PowerPC/PPCGenDAGISel.inc"),
2038 ("-gen-fast-isel", "lib/Target/PowerPC/PPCGenFastISel.inc"),
2039 ("-gen-callingconv", "lib/Target/PowerPC/PPCGenCallingConv.inc"),
2040 ("-gen-subtarget", "lib/Target/PowerPC/PPCGenSubtargetInfo.inc"),
2041 ("-gen-disassembler", "lib/Target/PowerPC/PPCGenDisassemblerTables.inc"),
2042 ("-gen-register-bank", "lib/Target/PowerPC/PPCGenRegisterBank.inc"),
2043 ("-gen-global-isel", "lib/Target/PowerPC/PPCGenGlobalISel.inc"),
2044 ("-gen-exegesis", "lib/Target/PowerPC/PPCGenExegesis.inc"),
2049 "short_name": "Sparc",
2051 ("-gen-asm-writer", "lib/Target/Sparc/SparcGenAsmWriter.inc"),
2052 ("-gen-asm-matcher", "lib/Target/Sparc/SparcGenAsmMatcher.inc"),
2053 ("-gen-emitter", "lib/Target/Sparc/SparcGenMCCodeEmitter.inc"),
2054 ("-gen-register-info", "lib/Target/Sparc/SparcGenRegisterInfo.inc"),
2055 ("-gen-instr-info", "lib/Target/Sparc/SparcGenInstrInfo.inc"),
2056 ("-gen-dag-isel", "lib/Target/Sparc/SparcGenDAGISel.inc"),
2057 ("-gen-callingconv", "lib/Target/Sparc/SparcGenCallingConv.inc"),
2058 ("-gen-subtarget", "lib/Target/Sparc/SparcGenSubtargetInfo.inc"),
2059 ("-gen-disassembler", "lib/Target/Sparc/SparcGenDisassemblerTables.inc"),
2060 ("-gen-searchable-tables", "lib/Target/Sparc/SparcGenSearchableTables.inc"),
2065 "short_name": "SystemZ",
2067 ("-gen-asm-matcher", "lib/Target/SystemZ/SystemZGenAsmMatcher.inc"),
2068 ("-gen-asm-writer", "lib/Target/SystemZ/SystemZGenAsmWriter.inc"),
2069 ("-gen-callingconv", "lib/Target/SystemZ/SystemZGenCallingConv.inc"),
2070 ("-gen-dag-isel", "lib/Target/SystemZ/SystemZGenDAGISel.inc"),
2071 ("-gen-disassembler", "lib/Target/SystemZ/SystemZGenDisassemblerTables.inc"),
2072 ("-gen-emitter", "lib/Target/SystemZ/SystemZGenMCCodeEmitter.inc"),
2073 ("-gen-instr-info", "lib/Target/SystemZ/SystemZGenInstrInfo.inc"),
2074 ("-gen-register-info", "lib/Target/SystemZ/SystemZGenRegisterInfo.inc"),
2075 ("-gen-subtarget", "lib/Target/SystemZ/SystemZGenSubtargetInfo.inc"),
2080 "short_name": "RISCV",
2082 ("-gen-asm-matcher", "lib/Target/RISCV/RISCVGenAsmMatcher.inc"),
2083 ("-gen-asm-writer", "lib/Target/RISCV/RISCVGenAsmWriter.inc"),
2084 ("-gen-compress-inst-emitter", "lib/Target/RISCV/RISCVGenCompressInstEmitter.inc"),
2085 ("-gen-dag-isel", "lib/Target/RISCV/RISCVGenDAGISel.inc"),
2086 ("-gen-disassembler", "lib/Target/RISCV/RISCVGenDisassemblerTables.inc"),
2087 ("-gen-instr-info", "lib/Target/RISCV/RISCVGenInstrInfo.inc"),
2088 ("-gen-emitter", "lib/Target/RISCV/RISCVGenMCCodeEmitter.inc"),
2089 ("-gen-pseudo-lowering", "lib/Target/RISCV/RISCVGenMCPseudoLowering.inc"),
2090 ("-gen-register-bank", "lib/Target/RISCV/RISCVGenRegisterBank.inc"),
2091 ("-gen-register-info", "lib/Target/RISCV/RISCVGenRegisterInfo.inc"),
2092 ("-gen-subtarget", "lib/Target/RISCV/RISCVGenSubtargetInfo.inc"),
2093 ("-gen-searchable-tables", "lib/Target/RISCV/RISCVGenSearchableTables.inc"),
2096 ":riscv_isel_target_gen",
2103 ("-gen-asm-matcher", "lib/Target/VE/VEGenAsmMatcher.inc"),
2104 ("-gen-asm-writer", "lib/Target/VE/VEGenAsmWriter.inc"),
2105 ("-gen-callingconv", "lib/Target/VE/VEGenCallingConv.inc"),
2106 ("-gen-dag-isel", "lib/Target/VE/VEGenDAGISel.inc"),
2107 ("-gen-disassembler", "lib/Target/VE/VEGenDisassemblerTables.inc"),
2108 ("-gen-emitter", "lib/Target/VE/VEGenMCCodeEmitter.inc"),
2109 ("-gen-instr-info", "lib/Target/VE/VEGenInstrInfo.inc"),
2110 ("-gen-register-info", "lib/Target/VE/VEGenRegisterInfo.inc"),
2111 ("-gen-subtarget", "lib/Target/VE/VEGenSubtargetInfo.inc"),
2115 "name": "WebAssembly",
2116 "short_name": "WebAssembly",
2118 ("-gen-disassembler", "lib/Target/WebAssembly/WebAssemblyGenDisassemblerTables.inc"),
2119 ("-gen-asm-writer", "lib/Target/WebAssembly/WebAssemblyGenAsmWriter.inc"),
2120 ("-gen-instr-info", "lib/Target/WebAssembly/WebAssemblyGenInstrInfo.inc"),
2121 ("-gen-dag-isel", "lib/Target/WebAssembly/WebAssemblyGenDAGISel.inc"),
2122 ("-gen-fast-isel", "lib/Target/WebAssembly/WebAssemblyGenFastISel.inc"),
2123 ("-gen-emitter", "lib/Target/WebAssembly/WebAssemblyGenMCCodeEmitter.inc"),
2124 ("-gen-register-info", "lib/Target/WebAssembly/WebAssemblyGenRegisterInfo.inc"),
2125 ("-gen-subtarget", "lib/Target/WebAssembly/WebAssemblyGenSubtargetInfo.inc"),
2126 ("-gen-asm-matcher", "lib/Target/WebAssembly/WebAssemblyGenAsmMatcher.inc"),
2131 "short_name": "X86",
2133 ("-gen-register-bank", "lib/Target/X86/X86GenRegisterBank.inc"),
2134 ("-gen-register-info", "lib/Target/X86/X86GenRegisterInfo.inc"),
2135 ("-gen-disassembler", "lib/Target/X86/X86GenDisassemblerTables.inc"),
2136 ("-gen-instr-info", "lib/Target/X86/X86GenInstrInfo.inc"),
2137 ("-gen-asm-writer", "lib/Target/X86/X86GenAsmWriter.inc"),
2138 ("-gen-asm-writer -asmwriternum=1", "lib/Target/X86/X86GenAsmWriter1.inc"),
2139 ("-gen-asm-matcher", "lib/Target/X86/X86GenAsmMatcher.inc"),
2140 ("-gen-dag-isel", "lib/Target/X86/X86GenDAGISel.inc"),
2141 ("-gen-fast-isel", "lib/Target/X86/X86GenFastISel.inc"),
2142 ("-gen-global-isel", "lib/Target/X86/X86GenGlobalISel.inc"),
2143 ("-gen-callingconv", "lib/Target/X86/X86GenCallingConv.inc"),
2144 ("-gen-subtarget", "lib/Target/X86/X86GenSubtargetInfo.inc"),
2145 ("-gen-x86-fold-tables -asmwriternum=1", "lib/Target/X86/X86GenFoldTables.inc"),
2146 ("-gen-x86-EVEX2VEX-tables", "lib/Target/X86/X86GenEVEX2VEXTables.inc"),
2147 ("-gen-exegesis", "lib/Target/X86/X86GenExegesis.inc"),
2148 ("-gen-x86-mnemonic-tables -asmwriternum=1", "lib/Target/X86/X86GenMnemonicTables.inc"),
2153 "short_name": "XCore",
2155 ("-gen-asm-writer", "lib/Target/XCore/XCoreGenAsmWriter.inc"),
2156 ("-gen-callingconv", "lib/Target/XCore/XCoreGenCallingConv.inc"),
2157 ("-gen-dag-isel", "lib/Target/XCore/XCoreGenDAGISel.inc"),
2158 ("-gen-disassembler", "lib/Target/XCore/XCoreGenDisassemblerTables.inc"),
2159 ("-gen-instr-info", "lib/Target/XCore/XCoreGenInstrInfo.inc"),
2160 ("-gen-register-info", "lib/Target/XCore/XCoreGenRegisterInfo.inc"),
2161 ("-gen-subtarget", "lib/Target/XCore/XCoreGenSubtargetInfo.inc"),
2164 ] if lib["name"] in llvm_targets]
2167 name = "x86_target_layering_problem_hdrs",
2168 textual_hdrs = ["lib/Target/X86/X86InstrInfo.h"],
2172 name = "common_target_td_sources",
2174 "include/llvm/CodeGen/*.td",
2175 "include/llvm/Frontend/Directive/*.td",
2176 "include/llvm/IR/Intrinsics*.td",
2177 "include/llvm/TableGen/*.td",
2178 "include/llvm/Target/*.td",
2179 "include/llvm/Target/GlobalISel/*.td",
2184 name = "amdgpu_isel_target_gen",
2185 strip_include_prefix = "lib/Target/AMDGPU",
2187 ("-gen-global-isel", "lib/Target/AMDGPU/AMDGPUGenGlobalISel.inc"),
2188 ("-gen-global-isel-combiner -combiners=AMDGPUPreLegalizerCombiner", "lib/Target/AMDGPU/AMDGPUGenPreLegalizeGICombiner.inc"),
2189 ("-gen-global-isel-combiner -combiners=AMDGPUPostLegalizerCombiner", "lib/Target/AMDGPU/AMDGPUGenPostLegalizeGICombiner.inc"),
2190 ("-gen-global-isel-combiner -combiners=AMDGPURegBankCombiner", "lib/Target/AMDGPU/AMDGPUGenRegBankGICombiner.inc"),
2192 tblgen = ":llvm-tblgen",
2193 td_file = "lib/Target/AMDGPU/AMDGPUGISel.td",
2195 ":common_target_td_sources",
2197 "lib/Target/AMDGPU/*.td",
2202 name = "r600_target_gen",
2203 strip_include_prefix = "lib/Target/AMDGPU",
2205 ("-gen-asm-writer", "lib/Target/AMDGPU/R600GenAsmWriter.inc"),
2206 ("-gen-callingconv", "lib/Target/AMDGPU/R600GenCallingConv.inc"),
2207 ("-gen-dag-isel", "lib/Target/AMDGPU/R600GenDAGISel.inc"),
2208 ("-gen-dfa-packetizer", "lib/Target/AMDGPU/R600GenDFAPacketizer.inc"),
2209 ("-gen-instr-info", "lib/Target/AMDGPU/R600GenInstrInfo.inc"),
2210 ("-gen-emitter", "lib/Target/AMDGPU/R600GenMCCodeEmitter.inc"),
2211 ("-gen-register-info", "lib/Target/AMDGPU/R600GenRegisterInfo.inc"),
2212 ("-gen-subtarget", "lib/Target/AMDGPU/R600GenSubtargetInfo.inc"),
2214 tblgen = ":llvm-tblgen",
2215 td_file = "lib/Target/AMDGPU/R600.td",
2217 ":common_target_td_sources",
2219 "lib/Target/AMDGPU/*.td",
2224 name = "riscv_isel_target_gen",
2225 strip_include_prefix = "lib/Target/RISCV",
2227 ("-gen-global-isel", "lib/Target/RISCV/RISCVGenGlobalISel.inc"),
2228 ("-gen-global-isel-combiner -combiners=RISCVO0PreLegalizerCombiner", "lib/Target/RISCV/RISCVGenO0PreLegalizeGICombiner.inc"),
2229 ("-gen-global-isel-combiner -combiners=RISCVPostLegalizerCombiner", "lib/Target/RISCV/RISCVGenPostLegalizeGICombiner.inc"),
2230 ("-gen-global-isel-combiner -combiners=RISCVPreLegalizerCombiner", "lib/Target/RISCV/RISCVGenPreLegalizeGICombiner.inc"),
2232 tblgen = ":llvm-tblgen",
2233 td_file = "lib/Target/RISCV/RISCVGISel.td",
2235 ":common_target_td_sources",
2237 "lib/Target/RISCV/**/*.td",
2243 name = target["name"] + "CommonTableGen",
2244 strip_include_prefix = "lib/Target/" + target["name"],
2245 tbl_outs = target["tbl_outs"],
2246 tblgen = ":llvm-tblgen",
2247 # MSVC isn't happy with long string literals, while other compilers
2248 # which support them get significant compile time improvements with
2249 # them enabled. Ideally this flag would only be enabled on Windows via
2250 # a select() on `@platforms//os:windows,`, but that would
2251 # require refactoring gentbl from a macro into a rule.
2252 # TODO(#92): Refactor gentbl to support this use
2253 tblgen_args = "--long-string-literals=0",
2254 td_file = "lib/Target/" + target["name"] + "/" + target["short_name"] + ".td",
2256 ":common_target_td_sources",
2258 "lib/Target/" + target["name"] + "/*.td",
2259 "lib/Target/" + target["name"] + "/GISel/*.td",
2261 deps = target.get("tbl_deps", []),
2264 name = target["name"] + "Info",
2265 srcs = ["lib/Target/" + target["name"] + "/TargetInfo/" + target["name"] + "TargetInfo.cpp"],
2266 hdrs = glob(["lib/Target/" + target["name"] + "/TargetInfo/*.h"]),
2268 # Workaround for https://github.com/bazelbuild/bazel/issues/3828
2269 # TODO(gcmn): Remove this when upgrading to a Bazel version containing
2270 # https://github.com/bazelbuild/bazel/commit/e3b7e17b05f1
2271 includes = ["lib/Target/" + target["name"]],
2272 strip_include_prefix = "lib/Target/" + target["name"],
2274 ":" + target["name"] + "CommonTableGen",
2280 # We cannot separate the `Utils` and `MCTargetDesc` sublibraries of
2281 # a number of targets due to crisscrossing inclusion of headers.
2283 name = target["name"] + "UtilsAndDesc",
2285 "lib/Target/" + target["name"] + "/MCTargetDesc/*.cpp",
2286 "lib/Target/" + target["name"] + "/Utils/*.cpp",
2288 # We have to include these headers here as well as in the `hdrs`
2289 # below to allow the `.cpp` files to use file-relative-inclusion to
2290 # find them, even though consumers of this library use inclusion
2291 # relative to the target with the `strip_includes_prefix` of this
2292 # library. This mixture is likely incompatible with header modules.
2293 "lib/Target/" + target["name"] + "/MCTargetDesc/*.h",
2294 "lib/Target/" + target["name"] + "/Utils/*.h",
2297 "lib/Target/" + target["name"] + "/MCTargetDesc/*.h",
2298 "lib/Target/" + target["name"] + "/Utils/*.h",
2300 # This a bit of a hack to allow us to expose common, internal
2301 # target header files to other libraries within the target via
2302 # target-relative includes. This usage of headers is inherently
2303 # non-modular as there is a mixture of target-relative inclusion
2304 # using this rule and file-relative inclusion using the repeated
2305 # listing of these headers in the `srcs` of subsequent rules.
2306 "lib/Target/" + target["name"] + "/*.h",
2308 # FIXME: The entries below should be `textual_hdrs` instead of
2309 # `hdrs`, but unfortunately that doesn't work with
2310 # `strip_include_prefix`:
2311 # https://github.com/bazelbuild/bazel/issues/12424
2313 # Once that issue is fixed and released, we can switch this to
2314 # `textual_hdrs` and remove the feature disabling the various Bazel
2315 # features (both current and under-development) that motivated the
2316 # distinction between these two.
2317 "lib/Target/" + target["name"] + "/*.def",
2318 "lib/Target/" + target["name"] + "/*.inc",
2319 "lib/Target/" + target["name"] + "/MCTargetDesc/*.def",
2327 strip_include_prefix = "lib/Target/" + target["name"],
2331 ":DebugInfoCodeView",
2338 ":" + target["name"] + "CommonTableGen",
2339 ":" + target["name"] + "Info",
2343 name = target["name"] + "CodeGen",
2345 "lib/Target/" + target["name"] + "/GISel/*.cpp",
2346 "lib/Target/" + target["name"] + "/GISel/*.h",
2347 "lib/Target/" + target["name"] + "/*.cpp",
2348 "lib/Target/" + target["name"] + "/*.h",
2350 hdrs = ["lib/Target/" + target["name"] + "/" + target["short_name"] + ".h"],
2352 features = ["-layering_check"],
2353 strip_include_prefix = "lib/Target/" + target["name"],
2354 textual_hdrs = glob([
2355 "lib/Target/" + target["name"] + "/*.def",
2356 "lib/Target/" + target["name"] + "/*.inc",
2367 ":Passes", # TODO(chandlerc): Likely a layering violation.
2375 ":" + target["name"] + "CommonTableGen",
2376 ":" + target["name"] + "Info",
2377 ":" + target["name"] + "UtilsAndDesc",
2381 name = target["name"] + "AsmParser",
2383 "lib/Target/" + target["name"] + "/AsmParser/*.cpp",
2384 "lib/Target/" + target["name"] + "/AsmParser/*.h",
2395 ":" + target["name"] + "CodeGen",
2396 ":" + target["name"] + "CommonTableGen",
2397 ":" + target["name"] + "Info",
2398 ":" + target["name"] + "UtilsAndDesc",
2401 # This target is a bit of a hack to allow us to expose internal
2402 # disassembler header files via internal target-relative include paths.
2403 # This usage of headers is inherently non-modular as there is a mixture of
2404 # target-relative inclusion using this rule and same-directory inclusion
2405 # using the repeated listing of these headers in the `srcs` below.
2407 name = target["name"] + "DisassemblerInternalHeaders",
2408 # FIXME: This should be `textual_hdrs` instead of `hdrs`, but
2409 # unfortunately that doesn't work with `strip_include_prefix`:
2410 # https://github.com/bazelbuild/bazel/issues/12424
2412 # Once that issue is fixed and released, we can switch this to
2413 # `textual_hdrs` and remove the feature disabling the various Bazel
2414 # features (both current and under-development) that motivated the
2415 # distinction between these two.
2417 "lib/Target/" + target["name"] + "/Disassembler/*.h",
2423 strip_include_prefix = "lib/Target/" + target["name"],
2426 name = target["name"] + "Disassembler",
2428 "lib/Target/" + target["name"] + "/Disassembler/*.cpp",
2429 "lib/Target/" + target["name"] + "/Disassembler/*.c",
2430 "lib/Target/" + target["name"] + "/Disassembler/*.h",
2433 features = ["-layering_check"],
2441 ":" + target["name"] + "CodeGen",
2442 ":" + target["name"] + "DisassemblerInternalHeaders",
2443 ":" + target["name"] + "CommonTableGen",
2444 ":" + target["name"] + "UtilsAndDesc",
2448 name = target["name"] + "TargetMCA",
2450 "lib/Target/" + target["name"] + "/MCA/*.cpp",
2451 "lib/Target/" + target["name"] + "/MCA/*.c",
2452 "lib/Target/" + target["name"] + "/MCA/*.h",
2455 features = ["-layering_check"],
2462 ":" + target["name"] + "DisassemblerInternalHeaders",
2463 ":" + target["name"] + "Info",
2464 ":" + target["name"] + "UtilsAndDesc",
2467 ] for target in llvm_target_lib_list]
2470 name = "AllTargetsCodeGens",
2473 target["name"] + "CodeGen"
2474 for target in llvm_target_lib_list
2479 name = "AllTargetsAsmParsers",
2482 target["name"] + "AsmParser"
2483 for target in llvm_target_lib_list
2488 name = "AllTargetsDisassemblers",
2491 target["name"] + "Disassembler"
2492 for target in llvm_target_lib_list
2497 name = "AllTargetsMCAs",
2500 target["name"] + "TargetMCA"
2501 for target in llvm_target_lib_list
2506 name = "pass_registry_def",
2508 textual_hdrs = ["lib/Passes/PassRegistry.def"],
2512 name = "MLPolicies",
2514 "lib/Analysis/ML/*.cpp",
2515 "lib/Analysis/ML/*.h",
2518 "include/llvm/Analysis/ML/*.h",
2534 hdrs = glob(["include/llvm/Passes/*.h"]) + ["include/llvm-c/Transforms/PassBuilder.h"],
2537 ":AggressiveInstCombine",
2540 ":common_transforms",
2551 ":pass_registry_def",
2567 "include/llvm/LTO/*.h",
2568 "include/llvm/LTO/legacy/*.h",
2570 "include/llvm-c/lto.h",
2595 ":common_transforms",
2601 name = "ExecutionEngine",
2603 "lib/ExecutionEngine/*.cpp",
2604 "lib/ExecutionEngine/*.h",
2605 "lib/ExecutionEngine/RuntimeDyld/*.cpp",
2606 "lib/ExecutionEngine/RuntimeDyld/*.h",
2607 "lib/ExecutionEngine/RuntimeDyld/Targets/*.cpp",
2608 "lib/ExecutionEngine/RuntimeDyld/Targets/*.h",
2612 "include/llvm/ExecutionEngine/*.h",
2615 "include/llvm/ExecutionEngine/MCJIT*.h",
2616 "include/llvm/ExecutionEngine/OProfileWrapper.h",
2619 "include/llvm-c/ExecutionEngine.h",
2630 ":OrcTargetProcess",
2640 name = "Interpreter",
2642 "lib/ExecutionEngine/Interpreter/*.cpp",
2643 "lib/ExecutionEngine/Interpreter/*.h",
2645 hdrs = ["include/llvm/ExecutionEngine/Interpreter.h"],
2658 name = "JITLinkTableGen",
2659 strip_include_prefix = "lib/ExecutionEngine/JITLink",
2661 "-gen-opt-parser-defs",
2662 "lib/ExecutionEngine/JITLink/COFFOptions.inc",
2664 tblgen = ":llvm-tblgen",
2665 td_file = "lib/ExecutionEngine/JITLink/COFFOptions.td",
2666 td_srcs = ["include/llvm/Option/OptParser.td"],
2672 "lib/ExecutionEngine/JITLink/*.cpp",
2673 "lib/ExecutionEngine/JITLink/*.h",
2676 "include/llvm/ExecutionEngine/JITLink/*.h",
2686 ":OrcTargetProcess",
2696 "lib/ExecutionEngine/MCJIT/*.cpp",
2697 "lib/ExecutionEngine/MCJIT/*.h",
2699 hdrs = glob(["include/llvm/ExecutionEngine/MCJIT*.h"]),
2716 "lib/ExecutionEngine/Orc/*.cpp",
2717 "lib/ExecutionEngine/Orc/*.h",
2720 "include/llvm/ExecutionEngine/Orc/*.h",
2721 "include/llvm/ExecutionEngine/Orc/RPC/*.h",
2723 "include/llvm-c/LLJIT.h",
2724 "include/llvm-c/Orc.h",
2725 "include/llvm-c/OrcEE.h",
2729 "@platforms//os:android": [],
2730 "@platforms//os:windows": [],
2731 "@platforms//os:freebsd": [],
2732 "@platforms//os:macos": [],
2733 "//conditions:default": [
2750 ":OrcTargetProcess",
2764 "lib/ExecutionEngine/Orc/Shared/*.cpp",
2767 "include/llvm/ExecutionEngine/Orc/Shared/*.h",
2786 name = "OrcDebugging",
2788 "lib/ExecutionEngine/Orc/Debugging/*.cpp",
2791 "include/llvm/ExecutionEngine/Orc/Debugging/*.h",
2807 name = "OrcTargetProcess",
2809 "lib/ExecutionEngine/Orc/TargetProcess/*.cpp",
2810 "lib/ExecutionEngine/Orc/TargetProcess/*.h",
2813 "include/llvm/ExecutionEngine/Orc/TargetProcess/*.h",
2817 "@platforms//os:android": [],
2818 "@platforms//os:windows": [],
2819 "@platforms//os:freebsd": [],
2820 "@platforms//os:macos": [],
2821 "//conditions:default": [
2843 name = "DWARFLinker",
2845 "lib/DWARFLinker/*.cpp",
2846 "lib/DWARFLinker/*.h",
2848 hdrs = glob(["include/llvm/DWARFLinker/*.h"]),
2863 name = "DWARFLinkerParallel",
2865 "lib/DWARFLinkerParallel/*.cpp",
2866 "lib/DWARFLinkerParallel/*.h",
2868 hdrs = glob(["include/llvm/DWARFLinkerParallel/*.h"]),
2884 name = "DllOptionsTableGen",
2885 strip_include_prefix = "lib/ToolDrivers/llvm-dlltool",
2887 "-gen-opt-parser-defs",
2888 "lib/ToolDrivers/llvm-dlltool/Options.inc",
2890 tblgen = ":llvm-tblgen",
2891 td_file = "lib/ToolDrivers/llvm-dlltool/Options.td",
2892 td_srcs = ["include/llvm/Option/OptParser.td"],
2896 name = "DlltoolDriver",
2897 srcs = glob(["lib/ToolDrivers/llvm-dlltool/*.cpp"]),
2898 hdrs = glob(["include/llvm/ToolDrivers/llvm-dlltool/*.h"]),
2901 ":DllOptionsTableGen",
2910 name = "LibOptionsTableGen",
2911 strip_include_prefix = "lib/ToolDrivers/llvm-lib",
2913 "-gen-opt-parser-defs",
2914 "lib/ToolDrivers/llvm-lib/Options.inc",
2916 tblgen = ":llvm-tblgen",
2917 td_file = "lib/ToolDrivers/llvm-lib/Options.td",
2918 td_srcs = ["include/llvm/Option/OptParser.td"],
2923 srcs = glob(["lib/ToolDrivers/llvm-lib/*.cpp"]),
2924 hdrs = glob(["include/llvm/ToolDrivers/llvm-lib/*.h"]),
2929 ":LibOptionsTableGen",
2937 name = "InterfaceStub",
2939 "lib/InterfaceStub/*.cpp",
2940 "lib/InterfaceStub/*.h",
2943 "include/llvm/InterfaceStub/*.h",
2957 name = "WindowsDriver",
2959 "lib/WindowsDriver/*.cpp",
2962 "include/llvm/WindowsDriver/*.h",
2973 name = "WindowsManifest",
2975 "lib/WindowsManifest/*.cpp",
2978 "include/llvm/WindowsManifest/*.h",
2994 "include/llvm/MCA/**/*.h",
3006 name = "llvm-mca-headers",
3008 "tools/llvm-mca/*.h",
3009 "tools/llvm-mca/Views/*.h",
3011 strip_include_prefix = "tools/llvm-mca",
3020 hdrs = glob(["include/llvm/XRay/*.h"]),
3029 # A flag to pick which `pfm` to use for Exegesis.
3030 # Usage: `--@llvm-project//llvm:pfm=<disable|external|system>`.
3031 # Flag documentation: https://bazel.build/extending/config
3034 build_setting_default = "external",
3036 "disable", # Don't include pfm at all
3037 "external", # Build pfm from source
3038 "system", # Use system pfm (non hermetic)
3043 name = "pfm_disable",
3044 flag_values = {":pfm": "disable"},
3048 name = "pfm_external",
3049 flag_values = {":pfm": "external"},
3053 name = "pfm_system",
3054 flag_values = {":pfm": "system"},
3059 # We want dependencies of this library to have -DHAVE_LIBPFM conditionally
3060 # defined, so we set `defines` instead of `copts`.
3062 ":pfm_external": ["HAVE_LIBPFM=1"],
3063 ":pfm_system": ["HAVE_LIBPFM=1"],
3064 "//conditions:default": [],
3067 ":pfm_external": ["@pfm//:pfm_external"],
3068 ":pfm_system": ["@pfm//:pfm_system"],
3069 "//conditions:default": [],
3076 "tools/llvm-exegesis/lib/*.cpp",
3077 # We have to include these headers here as well as in the `hdrs` below
3078 # to allow the `.cpp` files to use file-relative-inclusion to find
3079 # them, even though consumers of this library use inclusion relative to
3080 # `tools/llvm-exegesis/lib` with the `strip_includes_prefix` of this
3081 # library. This mixture appears to be incompatible with header modules.
3082 "tools/llvm-exegesis/lib/*.h",
3084 "tools/llvm-exegesis/lib/{}/*.cpp".format(t)
3085 for t in llvm_target_exegesis
3087 "tools/llvm-exegesis/lib/{}/*.h".format(t)
3088 for t in llvm_target_exegesis
3090 hdrs = glob(["tools/llvm-exegesis/lib/*.h"]),
3096 strip_include_prefix = "tools/llvm-exegesis/lib",
3098 ":AllTargetsAsmParsers",
3099 ":AllTargetsCodeGens",
3117 ################################################################################
3118 # LLVM toolchain and development binaries
3121 name = "DsymutilTableGen",
3122 strip_include_prefix = "tools/dsymutil",
3124 "-gen-opt-parser-defs",
3125 "tools/dsymutil/Options.inc",
3127 tblgen = ":llvm-tblgen",
3128 td_file = "tools/dsymutil/Options.td",
3129 td_srcs = ["include/llvm/Option/OptParser.td"],
3133 name = "dsymutil_main",
3134 out = "dsymutil-driver.cpp",
3136 "@TOOL_NAME@": "dsymutil",
3138 template = "cmake/modules/llvm-driver-template.cpp.in",
3144 "tools/dsymutil/*.cpp",
3145 "tools/dsymutil/*.h",
3146 ]) + ["dsymutil-driver.cpp"],
3150 ":AllTargetsCodeGens",
3155 ":DWARFLinkerParallel",
3158 ":DsymutilTableGen",
3180 ":AllTargetsAsmParsers",
3181 ":AllTargetsCodeGens",
3206 # ll scripts rely on symbols from dependent
3207 # libraries being resolvable.
3209 "@platforms//os:windows": [],
3210 "@platforms//os:macos": [],
3211 "//conditions:default": [
3212 "-Wl,--undefined=_ZTIi",
3213 "-Wl,--export-dynamic-symbol=_ZTIi",
3214 "-Wl,--export-dynamic-symbol=__cxa_begin_catch",
3215 "-Wl,--export-dynamic-symbol=__cxa_end_catch",
3216 "-Wl,--export-dynamic-symbol=__gxx_personality_v0",
3217 "-Wl,--export-dynamic-symbol=__cxa_allocate_exception",
3218 "-Wl,--export-dynamic-symbol=__cxa_throw",
3219 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBWrapper",
3220 "-Wl,--export-dynamic-symbol=llvm_orc_registerEHFrameSectionWrapper",
3221 "-Wl,--export-dynamic-symbol=llvm_orc_deregisterEHFrameSectionWrapper",
3226 ":AllTargetsAsmParsers",
3227 ":AllTargetsCodeGens",
3240 ":OrcTargetProcess",
3250 out = "llvm-ar-driver.cpp",
3252 "@TOOL_NAME@": "llvm_ar",
3254 template = "cmake/modules/llvm-driver-template.cpp.in",
3260 "tools/llvm-ar/*.cpp",
3261 "tools/llvm-ar/*.h",
3262 ]) + ["llvm-ar-driver.cpp"],
3266 ":AllTargetsAsmParsers",
3267 ":AllTargetsCodeGens",
3278 # We need to run llvm-ar with different basenames to make it run with
3279 # different behavior.
3281 name = "llvm-dlltool",
3282 binary = ":llvm-ar",
3287 binary = ":llvm-ar",
3291 name = "llvm-ranlib",
3292 binary = ":llvm-ar",
3298 "tools/llvm-as/*.cpp",
3299 "tools/llvm-as/*.h",
3313 name = "llvm-bcanalyzer",
3315 "tools/llvm-bcanalyzer/*.cpp",
3316 "tools/llvm-bcanalyzer/*.h",
3329 "tools/llvm-cat/*.cpp",
3344 name = "llvm-cfi-verify",
3346 "tools/llvm-cfi-verify/*.cpp",
3347 "tools/llvm-cfi-verify/lib/*.cpp",
3348 "tools/llvm-cfi-verify/lib/*.h",
3353 ":AllTargetsAsmParsers",
3354 ":AllTargetsCodeGens",
3355 ":AllTargetsDisassemblers",
3370 "tools/llvm-cov/*.cpp",
3371 "tools/llvm-cov/*.h",
3388 name = "CvtResTableGen",
3389 strip_include_prefix = "tools/llvm-cvtres",
3391 "-gen-opt-parser-defs",
3392 "tools/llvm-cvtres/Opts.inc",
3394 tblgen = ":llvm-tblgen",
3395 td_file = "tools/llvm-cvtres/Opts.td",
3396 td_srcs = ["include/llvm/Option/OptParser.td"],
3400 name = "llvm-cvtres",
3402 "tools/llvm-cvtres/*.cpp",
3403 "tools/llvm-cvtres/*.h",
3417 name = "llvm-cxxdump",
3419 "tools/llvm-cxxdump/*.cpp",
3420 "tools/llvm-cxxdump/*.h",
3425 ":AllTargetsCodeGens",
3434 name = "llvm-cxxmap",
3436 "tools/llvm-cxxmap/*.cpp",
3437 "tools/llvm-cxxmap/*.h",
3448 name = "CxxfiltOptsTableGen",
3449 strip_include_prefix = "tools/llvm-cxxfilt",
3451 "-gen-opt-parser-defs",
3452 "tools/llvm-cxxfilt/Opts.inc",
3454 tblgen = ":llvm-tblgen",
3455 td_file = "tools/llvm-cxxfilt/Opts.td",
3456 td_srcs = ["include/llvm/Option/OptParser.td"],
3460 name = "cxxfilt_main",
3461 out = "llvm-cxxfilt-driver.cpp",
3463 "@TOOL_NAME@": "llvm_cxxfilt",
3465 template = "cmake/modules/llvm-driver-template.cpp.in",
3469 name = "llvm-cxxfilt",
3471 "tools/llvm-cxxfilt/*.cpp",
3472 "tools/llvm-cxxfilt/*.h",
3473 ]) + ["llvm-cxxfilt-driver.cpp"],
3477 ":CxxfiltOptsTableGen",
3486 name = "llvm-debuginfo-analyzer",
3488 "tools/llvm-debuginfo-analyzer/*.cpp",
3489 "tools/llvm-debuginfo-analyzer/*.h",
3494 ":AllTargetsCodeGens",
3495 ":AllTargetsDisassemblers",
3496 ":DebugInfoLogicalView",
3502 name = "llvm-debuginfod-find",
3504 "tools/llvm-debuginfod-find/*.cpp",
3505 "tools/llvm-debuginfod-find/*.h",
3521 "tools/llvm-dis/*.cpp",
3522 "tools/llvm-dis/*.h",
3535 name = "llvm-dwarfdump",
3537 "tools/llvm-dwarfdump/*.cpp",
3538 "tools/llvm-dwarfdump/*.h",
3543 ":AllTargetsCodeGens",
3555 name = "DwarfutilOptionsTableGen",
3556 strip_include_prefix = "tools/llvm-dwarfutil",
3558 "-gen-opt-parser-defs",
3559 "tools/llvm-dwarfutil/Options.inc",
3561 tblgen = ":llvm-tblgen",
3562 td_file = "tools/llvm-dwarfutil/Options.td",
3563 td_srcs = ["include/llvm/Option/OptParser.td"],
3567 name = "llvm-dwarfutil",
3569 "tools/llvm-dwarfutil/*.cpp",
3570 "tools/llvm-dwarfutil/*.h",
3575 ":AllTargetsAsmParsers",
3576 ":AllTargetsCodeGens",
3579 ":DWARFLinkerParallel",
3581 ":DwarfutilOptionsTableGen",
3593 name = "DwpOptionsTableGen",
3594 strip_include_prefix = "tools/llvm-dwp",
3596 "-gen-opt-parser-defs",
3597 "tools/llvm-dwp/Opts.inc",
3599 tblgen = ":llvm-tblgen",
3600 td_file = "tools/llvm-dwp/Opts.td",
3601 td_srcs = ["include/llvm/Option/OptParser.td"],
3606 out = "llvm-dwp-driver.cpp",
3608 "@TOOL_NAME@": "llvm_dwp",
3610 template = "cmake/modules/llvm-driver-template.cpp.in",
3616 "tools/llvm-dwp/*.cpp",
3617 "tools/llvm-dwp/*.h",
3618 ]) + ["llvm-dwp-driver.cpp"],
3622 ":AllTargetsCodeGens",
3624 ":DwpOptionsTableGen",
3632 name = "llvm-exegesis",
3634 "tools/llvm-exegesis/llvm-exegesis.cpp",
3639 ":AllTargetsAsmParsers",
3640 ":AllTargetsCodeGens",
3641 ":AllTargetsDisassemblers",
3654 name = "llvm-extract",
3656 "tools/llvm-extract/*.cpp",
3657 "tools/llvm-extract/*.h",
3675 name = "GSYMUtilOptionsTableGen",
3676 strip_include_prefix = "tools/llvm-gsymutil",
3678 "-gen-opt-parser-defs",
3679 "tools/llvm-gsymutil/Opts.inc",
3681 tblgen = ":llvm-tblgen",
3682 td_file = "tools/llvm-gsymutil/Opts.td",
3683 td_srcs = ["include/llvm/Option/OptParser.td"],
3687 name = "gsymutil_main",
3688 out = "llvm-gsymutil-driver.cpp",
3690 "@TOOL_NAME@": "llvm_gsymutil",
3692 template = "cmake/modules/llvm-driver-template.cpp.in",
3696 name = "llvm-gsymutil",
3698 "tools/llvm-gsymutil/*.cpp",
3699 "tools/llvm-gsymutil/*.h",
3700 ]) + ["llvm-gsymutil-driver.cpp"],
3704 ":AllTargetsCodeGens",
3708 ":GSYMUtilOptionsTableGen",
3719 name = "IfsOptionsTableGen",
3720 strip_include_prefix = "tools/llvm-ifs",
3722 "-gen-opt-parser-defs",
3723 "tools/llvm-ifs/Opts.inc",
3725 tblgen = ":llvm-tblgen",
3726 td_file = "tools/llvm-ifs/Opts.td",
3727 td_srcs = ["include/llvm/Option/OptParser.td"],
3732 out = "llvm-ifs-driver.cpp",
3734 "@TOOL_NAME@": "llvm_ifs",
3736 template = "cmake/modules/llvm-driver-template.cpp.in",
3742 "tools/llvm-ifs/*.cpp",
3743 "tools/llvm-ifs/*.h",
3744 ]) + ["llvm-ifs-driver.cpp"],
3749 ":IfsOptionsTableGen",
3760 name = "llvm-jitlink",
3762 "tools/llvm-jitlink/*.cpp",
3763 "tools/llvm-jitlink/*.h",
3766 # Make symbols from the standard library dynamically resolvable.
3768 "@platforms//os:windows": [],
3769 "@platforms//os:macos": [],
3770 "//conditions:default": [
3771 "-Wl,--undefined=_ZTIi",
3772 "-Wl,--export-dynamic-symbol=_ZTIi",
3773 "-Wl,--export-dynamic-symbol=__cxa_begin_catch",
3774 "-Wl,--export-dynamic-symbol=__cxa_end_catch",
3775 "-Wl,--export-dynamic-symbol=__gxx_personality_v0",
3776 "-Wl,--export-dynamic-symbol=__cxa_allocate_exception",
3777 "-Wl,--export-dynamic-symbol=__cxa_throw",
3778 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBWrapper",
3783 ":AllTargetsAsmParsers",
3784 ":AllTargetsCodeGens",
3785 ":AllTargetsDisassemblers",
3798 ":OrcTargetProcess",
3806 name = "LibtoolDarwinOptionsTableGen",
3807 strip_include_prefix = "tools/llvm-libtool-darwin",
3809 "-gen-opt-parser-defs",
3810 "tools/llvm-libtool-darwin/Opts.inc",
3812 tblgen = ":llvm-tblgen",
3813 td_file = "tools/llvm-libtool-darwin/Opts.td",
3814 td_srcs = ["include/llvm/Option/OptParser.td"],
3818 name = "libtool-darwin_main",
3819 out = "llvm-libtool-darwin-driver.cpp",
3821 "@TOOL_NAME@": "llvm_libtool_darwin",
3823 template = "cmake/modules/llvm-driver-template.cpp.in",
3827 name = "llvm-libtool-darwin",
3829 "tools/llvm-libtool-darwin/*.cpp",
3830 "tools/llvm-libtool-darwin/*.h",
3831 ]) + ["llvm-libtool-darwin-driver.cpp"],
3835 ":AllTargetsAsmParsers",
3836 ":AllTargetsCodeGens",
3839 ":LibtoolDarwinOptionsTableGen",
3850 "tools/llvm-link/*.cpp",
3851 "tools/llvm-link/*.h",
3872 name = "LipoOptsTableGen",
3873 strip_include_prefix = "tools/llvm-lipo",
3875 "-gen-opt-parser-defs",
3876 "tools/llvm-lipo/LipoOpts.inc",
3878 tblgen = ":llvm-tblgen",
3879 td_file = "tools/llvm-lipo/LipoOpts.td",
3880 td_srcs = ["include/llvm/Option/OptParser.td"],
3885 out = "llvm-lipo-driver.cpp",
3887 "@TOOL_NAME@": "llvm_lipo",
3889 template = "cmake/modules/llvm-driver-template.cpp.in",
3895 "tools/llvm-lipo/llvm-lipo.cpp",
3896 ] + ["llvm-lipo-driver.cpp"],
3900 ":AllTargetsAsmParsers",
3903 ":LipoOptsTableGen",
3915 "tools/llvm-lto/*.cpp",
3916 "tools/llvm-lto/*.h",
3921 ":AllTargetsAsmParsers",
3922 ":AllTargetsCodeGens",
3938 "tools/llvm-lto2/*.cpp",
3939 "tools/llvm-lto2/*.h",
3944 ":AllTargetsAsmParsers",
3945 ":AllTargetsCodeGens",
3959 "tools/llvm-mc/*.cpp",
3960 "tools/llvm-mc/*.h",
3965 ":AllTargetsAsmParsers",
3966 ":AllTargetsCodeGens",
3967 ":AllTargetsDisassemblers",
3980 "tools/llvm-mca/*.cpp",
3981 "tools/llvm-mca/*.h",
3982 "tools/llvm-mca/Views/*.cpp",
3983 "tools/llvm-mca/Views/*.h",
3988 ":AllTargetsAsmParsers",
3989 ":AllTargetsCodeGens",
3990 ":AllTargetsDisassemblers",
3997 ":llvm-mca-headers",
4002 name = "MlTableGen",
4003 strip_include_prefix = "tools/llvm-ml",
4005 "-gen-opt-parser-defs",
4006 "tools/llvm-ml/Opts.inc",
4008 tblgen = ":llvm-tblgen",
4009 td_file = "tools/llvm-ml/Opts.td",
4010 td_srcs = ["include/llvm/Option/OptParser.td"],
4015 out = "llvm-ml-driver.cpp",
4017 "@TOOL_NAME@": "llvm_ml",
4019 template = "cmake/modules/llvm-driver-template.cpp.in",
4025 "tools/llvm-ml/*.cpp",
4026 "tools/llvm-ml/*.h",
4027 ]) + ["llvm-ml-driver.cpp"],
4031 ":AllTargetsAsmParsers",
4032 ":AllTargetsCodeGens",
4033 ":AllTargetsDisassemblers",
4045 name = "llvm-modextract",
4047 "tools/llvm-modextract/*.cpp",
4061 name = "MtTableGen",
4062 strip_include_prefix = "tools/llvm-mt",
4064 "-gen-opt-parser-defs",
4065 "tools/llvm-mt/Opts.inc",
4067 tblgen = ":llvm-tblgen",
4068 td_file = "tools/llvm-mt/Opts.td",
4069 td_srcs = ["include/llvm/Option/OptParser.td"],
4074 out = "llvm-mt-driver.cpp",
4076 "@TOOL_NAME@": "llvm_mt",
4078 template = "cmake/modules/llvm-driver-template.cpp.in",
4084 "tools/llvm-mt/*.cpp",
4085 "tools/llvm-mt/*.h",
4086 ]) + ["llvm-mt-driver.cpp"],
4098 name = "NmOptsTableGen",
4099 strip_include_prefix = "tools/llvm-nm",
4101 "-gen-opt-parser-defs",
4102 "tools/llvm-nm/Opts.inc",
4104 tblgen = ":llvm-tblgen",
4105 td_file = "tools/llvm-nm/Opts.td",
4106 td_srcs = ["include/llvm/Option/OptParser.td"],
4111 out = "llvm-nm-driver.cpp",
4113 "@TOOL_NAME@": "llvm_nm",
4115 template = "cmake/modules/llvm-driver-template.cpp.in",
4121 "tools/llvm-nm/*.cpp",
4122 "tools/llvm-nm/*.h",
4123 ]) + ["llvm-nm-driver.cpp"],
4127 ":AllTargetsAsmParsers",
4128 ":AllTargetsCodeGens",
4143 name = "llvm-objcopy-opts",
4144 strip_include_prefix = "tools/llvm-objcopy",
4146 "-gen-opt-parser-defs",
4147 "tools/llvm-objcopy/ObjcopyOpts.inc",
4149 tblgen = ":llvm-tblgen",
4150 td_file = "tools/llvm-objcopy/ObjcopyOpts.td",
4152 "include/llvm/Option/OptParser.td",
4153 "tools/llvm-objcopy/CommonOpts.td",
4158 name = "llvm-installnametool-opts",
4159 strip_include_prefix = "tools/llvm-objcopy",
4161 "-gen-opt-parser-defs",
4162 "tools/llvm-objcopy/InstallNameToolOpts.inc",
4164 tblgen = ":llvm-tblgen",
4165 td_file = "tools/llvm-objcopy/InstallNameToolOpts.td",
4167 "include/llvm/Option/OptParser.td",
4168 "tools/llvm-objcopy/CommonOpts.td",
4173 name = "llvm-strip-opts",
4174 strip_include_prefix = "tools/llvm-objcopy",
4176 "-gen-opt-parser-defs",
4177 "tools/llvm-objcopy/StripOpts.inc",
4179 tblgen = ":llvm-tblgen",
4180 td_file = "tools/llvm-objcopy/StripOpts.td",
4182 "include/llvm/Option/OptParser.td",
4183 "tools/llvm-objcopy/CommonOpts.td",
4188 name = "llvm-bitcode-strip-opts",
4189 strip_include_prefix = "tools/llvm-objcopy",
4191 "-gen-opt-parser-defs",
4192 "tools/llvm-objcopy/BitcodeStripOpts.inc",
4194 tblgen = ":llvm-tblgen",
4195 td_file = "tools/llvm-objcopy/BitcodeStripOpts.td",
4197 "include/llvm/Option/OptParser.td",
4198 "tools/llvm-objcopy/CommonOpts.td",
4203 name = "llvm-stress",
4205 "tools/llvm-stress/*.cpp",
4206 "tools/llvm-stress/*.h",
4217 name = "objcopy_main",
4218 out = "llvm-objcopy-driver.cpp",
4220 "@TOOL_NAME@": "llvm_objcopy",
4222 template = "cmake/modules/llvm-driver-template.cpp.in",
4226 name = "llvm-objcopy",
4228 "tools/llvm-objcopy/*.cpp",
4229 "tools/llvm-objcopy/*.h",
4230 ]) + ["llvm-objcopy-driver.cpp"],
4243 ":llvm-bitcode-strip-opts",
4244 ":llvm-installnametool-opts",
4245 ":llvm-objcopy-opts",
4251 name = "llvm-strip",
4252 binary = ":llvm-objcopy",
4256 name = "llvm-bitcode-strip",
4257 binary = ":llvm-objcopy",
4261 name = "llvm-install-name-tool",
4262 binary = ":llvm-objcopy",
4266 name = "objdump_main",
4267 out = "llvm-objdump-driver.cpp",
4269 "@TOOL_NAME@": "llvm_objdump",
4271 template = "cmake/modules/llvm-driver-template.cpp.in",
4275 name = "llvm-objdump",
4277 "tools/llvm-objdump/*.cpp",
4278 "tools/llvm-objdump/*.h",
4279 ]) + ["llvm-objdump-driver.cpp"],
4283 ":AllTargetsAsmParsers",
4284 ":AllTargetsCodeGens",
4285 ":AllTargetsDisassemblers",
4294 ":ObjdumpOptsTableGen",
4297 ":OtoolOptsTableGen",
4306 name = "ObjdumpOptsTableGen",
4307 strip_include_prefix = "tools/llvm-objdump",
4309 "-gen-opt-parser-defs",
4310 "tools/llvm-objdump/ObjdumpOpts.inc",
4312 tblgen = ":llvm-tblgen",
4313 td_file = "tools/llvm-objdump/ObjdumpOpts.td",
4314 td_srcs = ["include/llvm/Option/OptParser.td"],
4318 name = "llvm-otool",
4319 binary = ":llvm-objdump",
4323 name = "OtoolOptsTableGen",
4324 strip_include_prefix = "tools/llvm-objdump",
4326 "-gen-opt-parser-defs",
4327 "tools/llvm-objdump/OtoolOpts.inc",
4329 tblgen = ":llvm-tblgen",
4330 td_file = "tools/llvm-objdump/OtoolOpts.td",
4331 td_srcs = ["include/llvm/Option/OptParser.td"],
4335 name = "llvm-opt-report",
4337 "tools/llvm-opt-report/*.cpp",
4342 ":AllTargetsCodeGens",
4350 name = "llvm-pdbutil",
4352 "tools/llvm-pdbutil/*.cpp",
4353 "tools/llvm-pdbutil/*.h",
4360 ":DebugInfoCodeView",
4371 name = "profdata_main",
4372 out = "llvm-profdata-driver.cpp",
4374 "@TOOL_NAME@": "llvm_profdata",
4376 template = "cmake/modules/llvm-driver-template.cpp.in",
4380 name = "llvm-profdata",
4382 "tools/llvm-profdata/*.cpp",
4383 "tools/llvm-profdata/*.h",
4384 ]) + ["llvm-profdata-driver.cpp"],
4396 name = "llvm-profgen",
4398 "tools/llvm-profgen/*.cpp",
4399 "tools/llvm-profgen/*.h",
4404 ":AllTargetsCodeGens",
4405 ":AllTargetsDisassemblers",
4421 name = "RcTableGen",
4422 strip_include_prefix = "tools/llvm-rc",
4424 "-gen-opt-parser-defs",
4425 "tools/llvm-rc/Opts.inc",
4427 tblgen = ":llvm-tblgen",
4428 td_file = "tools/llvm-rc/Opts.td",
4429 td_srcs = ["include/llvm/Option/OptParser.td"],
4433 name = "WindresTableGen",
4434 strip_include_prefix = "tools/llvm-rc",
4436 "-gen-opt-parser-defs",
4437 "tools/llvm-rc/WindresOpts.inc",
4439 tblgen = ":llvm-tblgen",
4440 td_file = "tools/llvm-rc/WindresOpts.td",
4441 td_srcs = ["include/llvm/Option/OptParser.td"],
4444 # Workaround inability to put `.def` files into `srcs` with a library.
4446 name = "llvm-rc-defs-lib",
4447 textual_hdrs = glob(["tools/llvm-rc/*.def"]),
4452 out = "llvm-rc-driver.cpp",
4454 "@TOOL_NAME@": "llvm_rc",
4456 template = "cmake/modules/llvm-driver-template.cpp.in",
4462 "tools/llvm-rc/*.cpp",
4463 "tools/llvm-rc/*.h",
4464 ]) + ["llvm-rc-driver.cpp"],
4475 ":llvm-rc-defs-lib",
4480 name = "llvm-windres",
4481 binary = ":llvm-rc",
4485 name = "ReadobjOptsTableGen",
4486 strip_include_prefix = "tools/llvm-readobj",
4488 "-gen-opt-parser-defs",
4489 "tools/llvm-readobj/Opts.inc",
4491 tblgen = ":llvm-tblgen",
4492 td_file = "tools/llvm-readobj/Opts.td",
4493 td_srcs = ["include/llvm/Option/OptParser.td"],
4497 name = "readobj_main",
4498 out = "llvm-readobj-driver.cpp",
4500 "@TOOL_NAME@": "llvm_readobj",
4502 template = "cmake/modules/llvm-driver-template.cpp.in",
4506 name = "llvm-readobj",
4508 "tools/llvm-readobj/*.cpp",
4509 "tools/llvm-readobj/*.h",
4510 ]) + ["llvm-readobj-driver.cpp"],
4514 ":AllTargetsCodeGens",
4517 ":DebugInfoCodeView",
4523 ":ReadobjOptsTableGen",
4528 # Create an 'llvm-readelf' named binary from the 'llvm-readobj' tool.
4530 name = "llvm-readelf",
4531 binary = ":llvm-readobj",
4535 name = "llvm-reduce",
4537 "tools/llvm-reduce/**/*.cpp",
4538 "tools/llvm-reduce/**/*.h",
4541 includes = ["tools/llvm-reduce"],
4544 ":AllTargetsAsmParsers",
4545 ":AllTargetsCodeGens",
4564 name = "llvm-rtdyld",
4566 "tools/llvm-rtdyld/*.cpp",
4567 "tools/llvm-rtdyld/*.h",
4572 ":AllTargetsCodeGens",
4573 ":AllTargetsDisassemblers",
4585 name = "SizeOptsTableGen",
4586 strip_include_prefix = "tools/llvm-size",
4588 "-gen-opt-parser-defs",
4589 "tools/llvm-size/Opts.inc",
4591 tblgen = ":llvm-tblgen",
4592 td_file = "tools/llvm-size/Opts.td",
4593 td_srcs = ["include/llvm/Option/OptParser.td"],
4598 out = "llvm-size-driver.cpp",
4600 "@TOOL_NAME@": "llvm_size",
4602 template = "cmake/modules/llvm-driver-template.cpp.in",
4608 "tools/llvm-size/*.cpp",
4609 "tools/llvm-size/*.h",
4610 ]) + ["llvm-size-driver.cpp"],
4616 ":SizeOptsTableGen",
4622 name = "llvm-split",
4624 "tools/llvm-split/*.cpp",
4625 "tools/llvm-split/*.h",
4640 name = "StringsOptsTableGen",
4641 strip_include_prefix = "tools/llvm-strings",
4643 "-gen-opt-parser-defs",
4644 "tools/llvm-strings/Opts.inc",
4646 tblgen = ":llvm-tblgen",
4647 td_file = "tools/llvm-strings/Opts.td",
4648 td_srcs = ["include/llvm/Option/OptParser.td"],
4652 name = "llvm-strings",
4654 "tools/llvm-strings/*.cpp",
4655 "tools/llvm-strings/*.h",
4662 ":StringsOptsTableGen",
4668 name = "SymbolizerOptsTableGen",
4669 strip_include_prefix = "tools/llvm-symbolizer",
4671 "-gen-opt-parser-defs",
4672 "tools/llvm-symbolizer/Opts.inc",
4674 tblgen = ":llvm-tblgen",
4675 td_file = "tools/llvm-symbolizer/Opts.td",
4676 td_srcs = ["include/llvm/Option/OptParser.td"],
4680 name = "symbolizer_main",
4681 out = "llvm-symbolizer-driver.cpp",
4683 "@TOOL_NAME@": "llvm_symbolizer",
4685 template = "cmake/modules/llvm-driver-template.cpp.in",
4689 name = "llvm-symbolizer",
4691 "tools/llvm-symbolizer/*.cpp",
4692 "tools/llvm-symbolizer/*.h",
4693 ]) + [ "llvm-symbolizer-driver.cpp"],
4704 ":SymbolizerOptsTableGen",
4710 name = "llvm-addr2line",
4711 binary = ":llvm-symbolizer",
4715 name = "llvm-undname",
4717 "tools/llvm-undname/*.cpp",
4718 "tools/llvm-undname/*.h",
4731 "tools/llvm-xray/*.cpp",
4732 "tools/llvm-xray/*.cc",
4733 "tools/llvm-xray/*.h",
4754 "@platforms//os:windows": [],
4755 "@platforms//os:macos": [],
4756 "//conditions:default": ["-Wl,--export-dynamic"],
4760 ":AllTargetsAsmParsers",
4761 ":AllTargetsCodeGens",
4780 ":common_transforms",
4786 name = "SancovOptsTableGen",
4787 strip_include_prefix = "tools/sancov",
4789 "-gen-opt-parser-defs",
4790 "tools/sancov/Opts.inc",
4792 tblgen = ":llvm-tblgen",
4793 td_file = "tools/sancov/Opts.td",
4794 td_srcs = ["include/llvm/Option/OptParser.td"],
4798 name = "sancov_main",
4799 out = "sancov-driver.cpp",
4801 "@TOOL_NAME@": "sancov",
4803 template = "cmake/modules/llvm-driver-template.cpp.in",
4810 "tools/sancov/*.cpp",
4812 ]) + ["sancov-driver.cpp"],
4816 ":AllTargetsCodeGens",
4817 ":AllTargetsDisassemblers",
4824 ":SancovOptsTableGen",
4833 "tools/sanstats/*.cpp",
4834 "tools/sanstats/*.h",
4846 name = "split-file",
4848 "utils/split-file/*.cpp",
4849 "utils/split-file/*.h",
4858 ################################################################################
4859 # Begin testonly libraries
4862 name = "FuzzMutate",
4864 srcs = glob(["lib/FuzzMutate/*.cpp"]),
4865 hdrs = glob(["include/llvm/FuzzMutate/*.h"]),
4867 includes = ["include"],
4883 srcs = glob(["tools/llvm-diff/lib/*.cpp"]),
4884 hdrs = glob(["tools/llvm-diff/lib/*.h"]),
4894 srcs = ["utils/lit/lit.py"] + glob(["utils/lit/lit/**/*.py"]),
4898 name = "TestingADT",
4901 "include/llvm/Testing/ADT/*.h",
4906 "//third-party/unittest:gmock",
4911 name = "TestingSupport",
4914 "lib/Testing/Support/*.cpp",
4915 "lib/Testing/Support/*.h",
4917 hdrs = glob(["include/llvm/Testing/Support/*.h"]),
4922 "//third-party/unittest:gmock",
4923 "//third-party/unittest:gtest",
4928 name = "TestingAnnotations",
4930 srcs = ["lib/Testing/Annotations/Annotations.cpp"],
4931 hdrs = ["include/llvm/Testing/Annotations/Annotations.h"],
4933 deps = [":Support"],
4936 ################################################################################
4937 # Begin testonly binary utilities
4943 "utils/FileCheck/*.cpp",
4944 "utils/FileCheck/*.h",
4957 "tools/bugpoint/*.cpp",
4958 "tools/bugpoint/*.h",
4963 ":AllTargetsAsmParsers",
4964 ":AllTargetsCodeGens",
4980 ":common_transforms",
4996 name = "lli-child-target",
4999 "tools/lli/ChildTarget/*.cpp",
5000 "tools/lli/ChildTarget/*.h",
5003 # The tests load code into this binary that expect to see symbols
5004 # from libstdc++ such as __cxa_begin_catch and _ZTIi. The latter
5005 # isn't even used in the main binary, so we also need to force it
5008 "@platforms//os:windows": [],
5009 "@platforms//os:macos": [],
5010 "//conditions:default": [
5018 ":OrcTargetProcess",
5022 ":intrinsic_enums_gen",
5027 name = "llvm-c-test",
5030 "tools/llvm-c-test/*.c",
5031 "tools/llvm-c-test/*.cpp",
5032 "tools/llvm-c-test/*.h",
5036 ":AllTargetsAsmParsers",
5037 ":AllTargetsCodeGens",
5038 ":AllTargetsDisassemblers",
5066 "tools/llvm-diff/*.cpp",
5067 "tools/llvm-diff/*.h",
5081 name = "llvm-isel-fuzzer",
5084 "tools/llvm-isel-fuzzer/*.cpp",
5085 "tools/llvm-isel-fuzzer/*.h",
5090 ":AllTargetsAsmParsers",
5091 ":AllTargetsCodeGens",
5106 # This is really a Python script, but call it sh_binary to ignore the hyphen in
5107 # the path, which py_binary does not allow.
5108 # Also, note: llvm-locstats expects llvm-dwarfdump to be in the same directory
5111 name = "llvm-locstats",
5114 "utils/llvm-locstats/*.py",
5116 # llvm-locstats is a thin wrapper around llvm-dwarfdump.
5117 data = [":llvm-dwarfdump"],
5121 name = "llvm-original-di-preservation",
5123 srcs = ["utils/llvm-original-di-preservation.py"],
5135 deps = [":Support"],
5139 name = "llvm-opt-fuzzer",
5142 "tools/llvm-opt-fuzzer/*.cpp",
5147 ":AllTargetsCodeGens",
5163 name = "llvm-readtapi",
5166 "tools/llvm-readtapi/*.cpp",
5167 "tools/llvm-readtapi/*.h",
5179 name = "TLICheckerOptsTableGen",
5180 strip_include_prefix = "tools/llvm-tli-checker",
5182 "-gen-opt-parser-defs",
5183 "tools/llvm-tli-checker/Opts.inc",
5185 tblgen = ":llvm-tblgen",
5186 td_file = "tools/llvm-tli-checker/Opts.td",
5187 td_srcs = ["include/llvm/Option/OptParser.td"],
5191 name = "llvm-tli-checker",
5194 "tools/llvm-tli-checker/*.cpp",
5195 "tools/llvm-tli-checker/*.h",
5212 ":TLICheckerOptsTableGen",
5223 "tools/obj2yaml/*.cpp",
5224 "tools/obj2yaml/*.h",
5230 ":DebugInfoCodeView",
5239 name = "verify-uselistorder",
5241 "tools/verify-uselistorder/*.cpp",
5242 "tools/verify-uselistorder/*.h",
5261 "tools/yaml2obj/*.cpp",
5262 "tools/yaml2obj/*.h",
5268 ":DebugInfoCodeView",
5277 name = "yaml-bench",
5280 "utils/yaml-bench/*.cpp",