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("@rules_python//python:defs.bzl", "py_binary")
8 load("//mlir:tblgen.bzl", "td_library")
9 load(":binary_alias.bzl", "binary_alias")
10 load(":config.bzl", "llvm_config_defines")
11 load(":driver.bzl", "generate_driver_selects", "generate_driver_tools_def", "llvm_driver_cc_binary", "select_driver_tools")
12 load(":enum_targets_gen.bzl", "enum_targets_gen")
13 load(":targets.bzl", "llvm_targets")
14 load(":tblgen.bzl", "gentbl")
17 default_visibility = ["//visibility:public"],
18 features = ["layering_check"],
25 "cmake/modules/llvm-driver-template.cpp.in",
26 "include/llvm/BinaryFormat/Dwarf.def",
27 "include/llvm/CodeGen/SDNodeProperties.td",
28 "include/llvm/CodeGen/ValueTypes.td",
29 "include/llvm/Frontend/Directive/DirectiveBase.td",
30 "include/llvm/Frontend/OpenACC/ACC.td",
31 "include/llvm/Frontend/OpenMP/OMP.td",
32 "include/llvm/IR/Intrinsics.td",
33 "include/llvm/Option/OptParser.td",
35 # This one is needed for building and vendoring out lldb from off tree.
36 "utils/lldbDataFormatters.py",
39 # It may be tempting to add compiler flags here, but that should be avoided.
40 # The necessary warnings and other compile flags should be provided by the
41 # toolchain or the `.bazelrc` file. This is just a workaround until we have a
42 # widely available feature to enable unlimited stack frame instead of using
43 # this `Make` variable.
45 "$(STACK_FRAME_UNLIMITED)",
49 name = "targets_def_gen",
50 src = "include/llvm/Config/Targets.def.in",
51 out = "include/llvm/Config/Targets.def",
52 macro_name = "TARGET",
53 targets = llvm_targets,
56 # Enabled targets with ASM printers.
57 llvm_target_asm_printers = [
60 if glob(["lib/Target/{}/*AsmPrinter.cpp".format(t)])
64 name = "asm_printers_def_gen",
65 src = "include/llvm/Config/AsmPrinters.def.in",
66 out = "include/llvm/Config/AsmPrinters.def",
67 macro_name = "ASM_PRINTER",
68 targets = llvm_target_asm_printers,
71 # Enabled targets with ASM parsers.
72 llvm_target_asm_parsers = [
76 ["lib/Target/{}/AsmParser/CMakeLists.txt".format(t)],
82 name = "asm_parsers_def_gen",
83 src = "include/llvm/Config/AsmParsers.def.in",
84 out = "include/llvm/Config/AsmParsers.def",
85 macro_name = "ASM_PARSER",
86 targets = llvm_target_asm_parsers,
89 # Enabled targets with disassemblers.
90 llvm_target_disassemblers = [
94 ["lib/Target/{}/Disassembler/CMakeLists.txt".format(t)],
100 name = "disassemblers_def_gen",
101 src = "include/llvm/Config/Disassemblers.def.in",
102 out = "include/llvm/Config/Disassemblers.def",
103 macro_name = "DISASSEMBLER",
104 targets = llvm_target_disassemblers,
107 # Enabled targets with MCA.
110 for t in llvm_targets
112 ["lib/Target/{}/MCA/CMakeLists.txt".format(t)],
118 name = "target_mca_def_gen",
119 src = "include/llvm/Config/TargetMCAs.def.in",
120 out = "include/llvm/Config/TargetMCAs.def",
121 macro_name = "TARGETMCA",
122 targets = llvm_target_mcas,
125 # Enabled targets with exegesis.
126 llvm_target_exegesis = [
128 for t in llvm_targets
130 ["tools/llvm-exegesis/lib/{}/CMakeLists.txt".format(t)],
136 name = "target_exegesis_def_gen",
137 src = "include/llvm/Config/TargetExegesis.def.in",
138 out = "include/llvm/Config/TargetExegesis.def",
139 macro_name = "EXEGESIS",
140 placeholder_name = "@LLVM_ENUM_EXEGESIS@",
141 targets = llvm_target_exegesis,
145 name = "abi_breaking_h_gen",
146 out = "include/llvm/Config/abi-breaking.h",
148 # Define to enable checks that alter the LLVM C++ ABI
149 "#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS": "#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0",
151 # Define to enable reverse iteration of unordered llvm containers
152 "#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION": "#define LLVM_ENABLE_REVERSE_ITERATION 0",
154 template = "include/llvm/Config/abi-breaking.h.cmake",
157 # To enable diff testing out of tree
159 "include/llvm/Config/config.h.cmake",
160 "include/llvm/Config/llvm-config.h.cmake",
161 "include/llvm/Config/abi-breaking.h.cmake",
165 name = "OptParserTdFiles",
166 srcs = ["include/llvm/Option/OptParser.td"],
167 includes = ["include"],
170 llvm_config_target_defines = [
171 "LLVM_HAS_{}_TARGET=1".format(t)
172 for t in llvm_targets
178 "include/llvm/Config/abi-breaking.h",
179 "include/llvm/Config/llvm-config.h",
182 defines = llvm_config_defines + llvm_config_target_defines,
183 includes = ["include"],
185 "include/llvm/Config/AsmParsers.def",
186 "include/llvm/Config/AsmPrinters.def",
187 "include/llvm/Config/Disassemblers.def",
188 "include/llvm/Config/Targets.def",
189 "include/llvm/Config/TargetExegesis.def",
190 "include/llvm/Config/TargetMCAs.def",
191 # Needed for include scanner to find execinfo.h
192 "include/llvm/Config/config.h",
199 "lib/Demangle/*.cpp",
202 "include/llvm/Demangle/*.h",
203 "include/llvm/Demangle/*.def",
210 name = "generate_vcs_revision",
211 outs = ["include/llvm/Support/VCSRevision.h"],
212 cmd = "echo '#undef LLVM_REVISION' >> $@\n" +
213 "echo '#undef LLVM_REPOSITORY' >> $@\n",
217 name = "generate_static_extension_registry",
218 outs = ["include/llvm/Support/Extension.def"],
219 cmd = "echo -e '// extension handlers' >> $@\n" +
220 "echo -e '#undef HANDLE_EXTENSION' >> $@\n",
230 # To avoid a dependency cycle.
231 "include/llvm/Option/*.h",
233 "@platforms//os:windows": glob([
234 "lib/Support/Windows/*.inc",
236 "//conditions:default": glob([
237 "lib/Support/Unix/*.h",
238 "lib/Support/Unix/*.inc",
241 "lib/Support/BLAKE3/blake3.c",
242 "lib/Support/BLAKE3/blake3_dispatch.c",
243 "lib/Support/BLAKE3/blake3_impl.h",
244 "lib/Support/BLAKE3/blake3_portable.c",
245 "lib/Support/BLAKE3/llvm_blake3_prefix.h",
247 "@platforms//cpu:aarch64": [
248 "lib/Support/BLAKE3/blake3_neon.c",
250 "@platforms//cpu:x86_64": [
251 "lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S",
252 "lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S",
253 "lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S",
254 "lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S",
256 "//conditions:default": [
260 "include/llvm/Support/**/*.h",
261 "include/llvm/ADT/*.h",
263 "include/llvm-c/Core.h",
264 "include/llvm-c/DataTypes.h",
265 "include/llvm-c/Deprecated.h",
266 "include/llvm-c/DisassemblerTypes.h",
267 "include/llvm-c/Error.h",
268 "include/llvm-c/ErrorHandling.h",
269 "include/llvm-c/ExternC.h",
270 "include/llvm-c/Support.h",
271 "include/llvm-c/Types.h",
272 "include/llvm-c/blake3.h",
273 "include/llvm/ExecutionEngine/JITSymbol.h",
274 "include/llvm/Support/Extension.def",
275 "include/llvm/Support/VCSRevision.h",
279 "@platforms//cpu:aarch64": [
281 "//conditions:default": [
285 "@platforms//cpu:x86_64": [
287 "//conditions:default": [
294 includes = ["include"],
296 "@platforms//os:windows": [
300 "@platforms//os:freebsd": [
306 "@platforms//os:macos": [
310 "//conditions:default": [
316 textual_hdrs = glob([
317 "include/llvm/Support/*.def",
322 # We unconditionally depend on the custom LLVM zlib wrapper. This will
323 # be an empty library unless zlib is enabled, in which case it will
324 # both provide the necessary dependencies and configuration defines.
326 # We unconditionally depend on the custom LLVM zstd wrapper. This will
327 # be an empty library unless zstd is enabled, in which case it will
328 # both provide the necessary dependencies and configuration defines.
333 # Note: although FileCheck (the binary) is a test utility, some non-test
334 # targets depend on the FileCheck library target.
336 name = "FileCheckLib",
338 "lib/FileCheck/*.cpp",
341 hdrs = glob(["include/llvm/FileCheck/*.h"]),
349 "lib/LineEditor/*.cpp",
351 hdrs = glob(["include/llvm/LineEditor/*.h"]),
364 hdrs = glob(["include/llvm/Option/*.h"]),
375 "lib/TableGen/*.cpp",
378 hdrs = glob(["include/llvm/TableGen/*.h"]),
386 # This exists to avoid circular dependencies.
392 "include/llvm/IR/*.h",
395 "include/llvm/LinkAllPasses.h",
398 "include/llvm-c/Comdat.h",
399 "include/llvm-c/DebugInfo.h",
400 "include/llvm/IR/Value.def",
406 name = "BinaryFormat",
408 "lib/BinaryFormat/*.cpp",
411 "include/llvm/BinaryFormat/*.h",
414 includes = ["include"],
415 textual_hdrs = glob([
416 "include/llvm/BinaryFormat/*.def",
417 "include/llvm/BinaryFormat/ELFRelocs/*.def",
427 hdrs = glob(["include/llvm/DebugInfo/**/*.h"]),
429 textual_hdrs = glob(["include/llvm/DebugInfo/**/*.def"]),
437 name = "DebugInfoMSF",
439 "lib/DebugInfo/MSF/*.cpp",
441 hdrs = glob(["include/llvm/DebugInfo/MSF/*.h"]),
447 name = "DebugInfoBTF",
449 "lib/DebugInfo/BTF/*.cpp",
451 hdrs = glob(["include/llvm/DebugInfo/BTF/*.h"]) + [
452 "include/llvm/DebugInfo/BTF/BTF.def",
463 name = "DebugInfoCodeView",
465 "lib/DebugInfo/CodeView/*.cpp",
468 "include/llvm/DebugInfo/CodeView/*.h",
471 textual_hdrs = glob([
472 "include/llvm/DebugInfo/CodeView/*.def",
482 name = "DebugInfoLogicalView",
484 "lib/DebugInfo/LogicalView/**/*.cpp",
487 "include/llvm/DebugInfo/LogicalView/**/*.h",
493 ":DebugInfoCodeView",
505 name = "DebugInfoPDB",
507 "lib/DebugInfo/PDB/*.cpp",
508 "lib/DebugInfo/PDB/Native/*.cpp",
511 "include/llvm/DebugInfo/PDB/*.h",
512 "include/llvm/DebugInfo/PDB/Native/*.h",
519 ":DebugInfoCodeView",
530 "lib/Debuginfod/*.cpp",
533 "include/llvm/Debuginfod/*.h",
551 "include/llvm/MC/*.h",
556 ":DebugInfoCodeView",
565 name = "DebugInfoDWARF",
567 "lib/DebugInfo/DWARF/*.cpp",
569 hdrs = glob(["include/llvm/DebugInfo/DWARF/*.h"]),
582 name = "DebugInfoGSYM",
584 "lib/DebugInfo/GSYM/*.cpp",
586 hdrs = glob(["include/llvm/DebugInfo/GSYM/*.h"]),
600 "lib/DebugInfo/Symbolize/*.cpp",
603 "include/llvm/DebugInfo/Symbolize/*.h",
604 "include/llvm/Debuginfod/*.h",
619 # Command line flag to control which tools get included in the llvm driver binary.
620 # The macro also generates config_setting targets used by select_driver_tools().
621 generate_driver_selects(name = "driver-tools")
623 generate_driver_tools_def(
624 name = "gen_llvm_driver_tools_def",
625 out = "LLVMDriverTools.def",
626 driver_tools = select_driver_tools(":driver-tools"),
629 # Workaround inability to put `.def` files into `srcs` with a library
631 name = "llvm_driver_tools_def_lib",
633 textual_hdrs = ["LLVMDriverTools.def"],
638 srcs = glob(["tools/llvm-driver/*.cpp"]),
641 ":llvm_driver_tools_def_lib",
642 ] + select_driver_tools(":driver-tools"),
646 name = "llvm-min-tblgen",
648 "utils/TableGen/Basic/ARMTargetDefEmitter.cpp",
649 "utils/TableGen/Basic/Attributes.cpp",
650 "utils/TableGen/Basic/CodeGenIntrinsics.cpp",
651 "utils/TableGen/Basic/CodeGenIntrinsics.h",
652 "utils/TableGen/Basic/SDNodeProperties.cpp",
653 "utils/TableGen/Basic/SDNodeProperties.h",
654 "utils/TableGen/Basic/TableGen.h",
655 "utils/TableGen/Basic/TableGen.cpp",
656 "utils/TableGen/Basic/SequenceToOffsetTable.h",
657 "utils/TableGen/Basic/DirectiveEmitter.cpp",
658 "utils/TableGen/Basic/IntrinsicEmitter.cpp",
659 "utils/TableGen/Basic/RISCVTargetDefEmitter.cpp",
660 "utils/TableGen/Basic/VTEmitter.cpp",
661 "utils/TableGen/llvm-min-tblgen.cpp",
673 name = "TableGenGlobalISel",
675 "utils/TableGen/Common/GlobalISel/CodeExpander.cpp",
678 # We have to include these headers here as well as in the `hdrs` below
679 # to allow the `.cpp` files to use file-relative-inclusion to find
680 # them, even though consumers of this library use inclusion relative to
681 # `utils/TableGen` with the `strip_includes_prefix` of this library.
682 # This mixture appears to be incompatible with header modules.
683 "utils/TableGen/Common/GlobalISel/CodeExpander.h",
684 "utils/TableGen/Common/GlobalISel/CodeExpansions.h",
687 features = ["-header_modules"],
688 strip_include_prefix = "utils/TableGen",
698 name = "llvm-tblgen-headers",
699 textual_hdrs = glob(["utils/TableGen/*.def"]),
703 name = "llvm-tblgen",
706 "utils/TableGen/*.cpp",
707 "utils/TableGen/*.h",
708 "utils/TableGen/Basic/*.cpp",
709 "utils/TableGen/Basic/*.h",
710 "utils/TableGen/Common/*.cpp",
711 "utils/TableGen/Common/*.h",
712 "utils/TableGen/Common/GlobalISel/*.cpp",
713 "utils/TableGen/Common/GlobalISel/*.h",
715 # Some tablegen sources include headers from MC, so these have to be
716 # listed here. MC uses headers produced by tablegen, so it cannot be a
717 # regular dependency.
718 "include/llvm/MC/*.h",
721 "utils/TableGen/Common/GlobalISel/CodeExpander.cpp",
722 "utils/TableGen/llvm-min-tblgen.cpp",
725 "include/llvm/TargetParser/SubtargetFeature.h",
728 includes = ["utils/TableGen"],
734 ":TableGenGlobalISel",
737 ":llvm-tblgen-headers",
743 name = "intrinsic_enums_gen",
744 tbl_outs = [("-gen-intrinsic-enums", "include/llvm/IR/IntrinsicEnums.inc")],
745 tblgen = ":llvm-min-tblgen",
746 td_file = "include/llvm/IR/Intrinsics.td",
748 "include/llvm/CodeGen/*.td",
749 "include/llvm/IR/Intrinsics*.td",
754 name = "intrinsics_impl_gen",
755 tbl_outs = [("-gen-intrinsic-impl", "include/llvm/IR/IntrinsicImpl.inc")],
756 tblgen = ":llvm-min-tblgen",
757 td_file = "include/llvm/IR/Intrinsics.td",
759 "include/llvm/CodeGen/*.td",
760 "include/llvm/IR/Intrinsics*.td",
766 tbl_outs = [("-gen-vt", "include/llvm/CodeGen/GenVT.inc")],
767 tblgen = ":llvm-min-tblgen",
768 td_file = "include/llvm/CodeGen/ValueTypes.td",
770 "include/llvm/CodeGen/ValueTypes.td",
774 # Note that the intrinsics are not currently set up so they can be pruned for
776 llvm_target_intrinsics_list = [
779 "intrinsic_prefix": "aarch64",
783 "intrinsic_prefix": "amdgcn",
787 "intrinsic_prefix": "arm",
791 "intrinsic_prefix": "bpf",
795 "intrinsic_prefix": "dx",
799 "intrinsic_prefix": "hexagon",
803 "intrinsic_prefix": "loongarch",
807 "intrinsic_prefix": "mips",
811 "intrinsic_prefix": "nvvm",
815 "intrinsic_prefix": "ppc",
819 "intrinsic_prefix": "r600",
823 "intrinsic_prefix": "riscv",
827 "intrinsic_prefix": "s390",
831 "intrinsic_prefix": "spv",
835 "intrinsic_prefix": "ve",
838 "name": "WebAssembly",
839 "intrinsic_prefix": "wasm",
843 "intrinsic_prefix": "x86",
847 "intrinsic_prefix": "xcore",
853 name = "intrinsic_" + target["name"] + "_gen",
855 "-gen-intrinsic-enums -intrinsic-prefix=" + target["intrinsic_prefix"],
856 "include/llvm/IR/Intrinsics" + target["name"] + ".h",
858 tblgen = ":llvm-min-tblgen",
859 td_file = "include/llvm/IR/Intrinsics.td",
861 "include/llvm/CodeGen/*.td",
862 "include/llvm/IR/*.td",
865 ] for target in llvm_target_intrinsics_list]
868 name = "attributes_gen",
869 tbl_outs = [("-gen-attrs", "include/llvm/IR/Attributes.inc")],
870 tblgen = ":llvm-min-tblgen",
871 td_file = "include/llvm/IR/Attributes.td",
872 td_srcs = ["include/llvm/IR/Attributes.td"],
876 name = "BitstreamReader",
878 "lib/Bitstream/Reader/*.cpp",
881 "include/llvm/Bitstream/BitCodeEnums.h",
882 "include/llvm/Bitstream/BitCodes.h",
883 "include/llvm/Bitstream/BitstreamReader.h",
892 name = "BitstreamWriter",
894 "include/llvm/Bitstream/BitCodeEnums.h",
895 "include/llvm/Bitstream/BitCodes.h",
896 "include/llvm/Bitstream/BitstreamWriter.h",
911 exclude = ["lib/Remarks/RemarkLinker.cpp"],
915 "include/llvm/Remarks/*.h",
917 exclude = ["include/llvm/Remarks/RemarkLinker.h"],
919 "include/llvm-c/Remarks.h",
930 name = "remark_linker",
931 srcs = ["lib/Remarks/RemarkLinker.cpp"],
932 hdrs = ["include/llvm/Remarks/RemarkLinker.h"],
942 name = "llvm_intrinsics_headers",
944 "include/llvm/IR/Intrinsics" + target["name"] + ".h"
945 for target in llvm_target_intrinsics_list
958 "include/llvm/IR/*.h",
961 "include/llvm/LinkAllPasses.h",
964 "include/llvm-c/Comdat.h",
965 "include/llvm-c/DebugInfo.h",
966 "include/llvm/Analysis/SimplifyQuery.h",
967 "include/llvm/Analysis/ValueTracking.h",
968 "include/llvm/Analysis/WithCache.h",
969 ] + [":llvm_intrinsics_headers"],
971 textual_hdrs = glob(["include/llvm/IR/*.def"]),
980 ":intrinsic_enums_gen",
981 ":intrinsics_impl_gen",
988 "lib/Bitcode/Reader/*.cpp",
989 "lib/Bitcode/Reader/*.h",
992 "include/llvm-c/BitReader.h",
993 "include/llvm/Bitcode/BitcodeAnalyzer.h",
994 "include/llvm/Bitcode/BitcodeCommon.h",
995 "include/llvm/Bitcode/BitcodeReader.h",
996 "include/llvm/Bitcode/LLVMBitCodes.h",
1012 "lib/MC/MCParser/*.cpp",
1014 hdrs = glob(["include/llvm/MC/MCParser/*.h"]),
1018 ":DebugInfoCodeView",
1030 "lib/TextAPI/**/*.cpp",
1032 exclude = ["lib/TextAPI/BinaryReader/**"],
1036 "include/llvm/TextAPI/**/*.h",
1037 "include/llvm/TextAPI/**/*.def",
1038 "lib/TextAPI/**/*.h",
1041 "lib/TextAPI/BinaryReader/**",
1042 "include/llvm/TextAPI/DylibReader.h",
1054 name = "TextAPIBinaryReader",
1056 "lib/TextAPI/BinaryReader/**/*.cpp",
1058 hdrs = ["include/llvm/TextAPI/DylibReader.h"],
1072 "lib/ObjCopy/**/*.cpp",
1073 "lib/ObjCopy/**/*.h",
1076 "include/llvm/ObjCopy/**/*.h",
1079 includes = ["lib/ObjCopy"],
1088 ":intrinsics_impl_gen",
1099 "include/llvm/Object/*.h",
1101 "include/llvm-c/Object.h",
1119 name = "ObjectYAML",
1121 "lib/ObjectYAML/*.cpp",
1123 hdrs = glob(["include/llvm/ObjectYAML/*.h"]),
1127 ":DebugInfoCodeView",
1136 name = "ProfileData",
1138 "lib/ProfileData/*.cpp",
1141 "include/llvm/ProfileData/*.h",
1142 "include/llvm/ProfileData/*.inc",
1163 "lib/ProfileData/Coverage/*.cpp",
1165 hdrs = glob(["include/llvm/ProfileData/Coverage/*.h"]),
1180 "lib/Analysis/*.cpp",
1185 "include/llvm/Analysis/*.h",
1186 "include/llvm/Analysis/Utils/*.h",
1189 "include/llvm-c/Analysis.h",
1192 textual_hdrs = glob([
1193 "include/llvm/Analysis/*.def",
1209 "lib/Bitcode/Writer/*.cpp",
1210 "lib/Bitcode/Writer/*.h",
1213 "include/llvm-c/BitWriter.h",
1214 "include/llvm/Bitcode/BitcodeCommon.h",
1215 "include/llvm/Bitcode/BitcodeConvenience.h",
1216 "include/llvm/Bitcode/BitcodeWriter.h",
1217 "include/llvm/Bitcode/BitcodeWriterPass.h",
1218 "include/llvm/Bitcode/LLVMBitCodes.h",
1241 "include/llvm/Target/*.h",
1243 "include/llvm-c/Target.h",
1244 "include/llvm-c/TargetMachine.h",
1259 name = "common_target_td_sources",
1261 "include/llvm/CodeGen/*.td",
1262 "include/llvm/Frontend/Directive/*.td",
1263 "include/llvm/IR/Intrinsics*.td",
1264 "include/llvm/TableGen/*.td",
1265 "include/llvm/Target/*.td",
1266 "include/llvm/Target/GlobalISel/*.td",
1271 name = "ARMTargetParserDefGen",
1272 tbl_outs = [("-gen-arm-target-def", "include/llvm/TargetParser/ARMTargetParserDef.inc")],
1273 tblgen = ":llvm-min-tblgen",
1274 td_file = "lib/Target/ARM/ARM.td",
1276 ":common_target_td_sources",
1278 "lib/Target/ARM/**/*.td",
1283 name = "AArch64TargetParserDefGen",
1284 tbl_outs = [("-gen-arm-target-def", "include/llvm/TargetParser/AArch64TargetParserDef.inc")],
1285 tblgen = ":llvm-min-tblgen",
1286 td_file = "lib/Target/AArch64/AArch64.td",
1288 ":common_target_td_sources",
1290 "lib/Target/AArch64/**/*.td",
1295 name = "RISCVTargetParserDefGen",
1296 tbl_outs = [("-gen-riscv-target-def", "include/llvm/TargetParser/RISCVTargetParserDef.inc")],
1297 tblgen = ":llvm-min-tblgen",
1298 td_file = "lib/Target/RISCV/RISCV.td",
1300 ":common_target_td_sources",
1302 "lib/Target/RISCV/**/*.td",
1307 name = "TargetParser",
1309 "lib/TargetParser/*.cpp",
1311 "@platforms//os:windows": glob([
1312 "lib/TargetParser/Windows/*.inc",
1314 "//conditions:default": glob([
1315 "lib/TargetParser/Unix/*.inc",
1319 "include/llvm/TargetParser/*.h",
1322 includes = ["include"],
1324 "include/llvm/TargetParser/AArch64CPUFeatures.inc",
1325 "include/llvm/TargetParser/AArch64FeatPriorities.inc",
1326 "include/llvm/TargetParser/AArch64TargetParserDef.inc",
1327 "include/llvm/TargetParser/ARMTargetParserDef.inc",
1328 "include/llvm/TargetParser/RISCVTargetParserDef.inc",
1330 "include/llvm/TargetParser/*.def",
1343 hdrs = glob(["include/llvm/DWP/*.h"]),
1355 name = "TransformUtils",
1357 "lib/Transforms/Utils/*.cpp",
1359 hdrs = glob(["include/llvm/Transforms/Utils/*.h"]) + [
1360 "include/llvm/Transforms/Utils.h",
1377 name = "InstCombineTableGen",
1378 strip_include_prefix = "lib/Target/AMDGPU",
1380 "-gen-searchable-tables",
1381 "lib/Target/AMDGPU/InstCombineTables.inc",
1383 tblgen = ":llvm-tblgen",
1384 td_file = "lib/Target/AMDGPU/InstCombineTables.td",
1386 "lib/Target/AMDGPU/*.td",
1388 ":common_target_td_sources",
1393 name = "InstCombine",
1395 "lib/Transforms/InstCombine/*.cpp",
1396 "lib/Transforms/InstCombine/*.h",
1398 hdrs = glob(["include/llvm/Transforms/InstCombine/*.h"]),
1411 name = "AggressiveInstCombine",
1413 "lib/Transforms/AggressiveInstCombine/*.cpp",
1414 "lib/Transforms/AggressiveInstCombine/*.h",
1417 "include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h",
1429 name = "Instrumentation",
1431 "lib/Transforms/Instrumentation/*.cpp",
1432 "lib/Transforms/Instrumentation/*.h",
1433 "lib/Transforms/Instrumentation/*.inc",
1435 hdrs = glob(["include/llvm/Transforms/Instrumentation/*.h"]) + [
1436 "include/llvm/Transforms/Utils/Instrumentation.h",
1458 "lib/Transforms/ObjCARC/*.cpp",
1459 "lib/Transforms/ObjCARC/*.h",
1461 hdrs = ["include/llvm/Transforms/ObjCARC.h"],
1476 "lib/SandboxIR/*.cpp",
1478 hdrs = glob(["include/llvm/SandboxIR/*.h"]),
1480 textual_hdrs = ["include/llvm/SandboxIR/Values.def"],
1491 "lib/Transforms/Scalar/*.cpp",
1493 hdrs = glob(["include/llvm/Transforms/Scalar/*.h"]) + [
1494 "include/llvm/Transforms/Scalar.h",
1498 ":AggressiveInstCombine",
1514 "lib/Transforms/Vectorize/**/*.cpp",
1515 "lib/Transforms/Vectorize/**/*.h",
1518 "include/llvm/Transforms/Vectorize/**/*.h",
1522 "lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def",
1537 name = "FrontendDebug",
1539 "include/llvm/Frontend/Debug/*.h",
1548 name = "FrontendDriver",
1550 "lib/Frontend/Driver/*.cpp",
1553 "include/llvm/Frontend/Driver/*.h",
1563 name = "FrontendHLSL",
1565 "lib/Frontend/HLSL/*.cpp",
1568 "include/llvm/Frontend/HLSL/*.h",
1578 name = "FrontendOffloading",
1580 "lib/Frontend/Offloading/*.cpp",
1583 "include/llvm/Frontend/Offloading/*.h",
1597 name = "omp_td_files",
1599 "include/llvm/Frontend/OpenMP/*.td",
1600 "include/llvm/Frontend/Directive/*.td",
1608 ("--gen-directive-decl", "include/llvm/Frontend/OpenMP/OMP.h.inc"),
1610 tblgen = ":llvm-min-tblgen",
1611 td_file = "include/llvm/Frontend/OpenMP/OMP.td",
1612 td_srcs = [":omp_td_files"],
1616 name = "omp_gen_impl",
1619 ("--gen-directive-impl", "include/llvm/Frontend/OpenMP/OMP.inc"),
1621 tblgen = ":llvm-min-tblgen",
1622 td_file = "include/llvm/Frontend/OpenMP/OMP.td",
1623 td_srcs = [":omp_td_files"],
1627 name = "FrontendAtomic",
1629 "lib/Frontend/Atomic/*.cpp",
1632 "include/llvm/Frontend/Atomic/*.h",
1642 name = "FrontendOpenMP",
1644 "lib/Frontend/OpenMP/*.cpp",
1647 "include/llvm/Frontend/OpenMP/*.h",
1649 "include/llvm/Frontend/OpenMP/OMP.h.inc",
1650 "include/llvm/Frontend/OpenMP/OMP.inc",
1653 textual_hdrs = glob([
1654 "include/llvm/Frontend/OpenMP/*.def",
1662 ":FrontendOffloading",
1673 name = "acc_td_files",
1675 "include/llvm/Frontend/OpenACC/*.td",
1676 "include/llvm/Frontend/Directive/*.td",
1684 ("--gen-directive-decl", "include/llvm/Frontend/OpenACC/ACC.h.inc"),
1686 tblgen = ":llvm-min-tblgen",
1687 td_file = "include/llvm/Frontend/OpenACC/ACC.td",
1688 td_srcs = [":acc_td_files"],
1692 name = "acc_gen_impl",
1695 ("--gen-directive-impl", "include/llvm/Frontend/OpenACC/ACC.inc"),
1697 tblgen = ":llvm-min-tblgen",
1698 td_file = "include/llvm/Frontend/OpenACC/ACC.td",
1699 td_srcs = [":acc_td_files"],
1703 name = "FrontendOpenACC",
1705 "lib/Frontend/OpenACC/*.cpp",
1707 "include/llvm/Frontend/OpenACC/ACC.inc",
1709 hdrs = ["include/llvm/Frontend/OpenACC/ACC.h.inc"],
1722 "lib/AsmParser/*.cpp",
1724 hdrs = glob(["include/llvm/AsmParser/*.h"]),
1737 "lib/IRPrinter/*.cpp",
1740 "include/llvm/IRPrinter/*.h",
1753 "lib/IRReader/*.cpp",
1756 "include/llvm/IRReader/*.h",
1758 "include/llvm-c/IRReader.h",
1777 "include/llvm/Linker/*.h",
1779 "include/llvm-c/Linker.h",
1795 "lib/Transforms/IPO/*.cpp",
1798 "include/llvm/Transforms/IPO/*.h",
1800 "include/llvm/Transforms/IPO.h",
1804 ":AggressiveInstCombine",
1833 "lib/Transforms/CFGuard/*.cpp",
1835 hdrs = ["include/llvm/Transforms/CFGuard.h"],
1847 "lib/Transforms/HipStdPar/*.cpp",
1849 hdrs = ["include/llvm/Transforms/HipStdPar/HipStdPar.h"],
1861 name = "Coroutines",
1863 "lib/Transforms/Coroutines/*.cpp",
1864 "lib/Transforms/Coroutines/*.h",
1866 hdrs = glob(["include/llvm/Transforms/Coroutines/*.h"]),
1880 # Meta-target for clients which depend on all of the transforms libraries.
1882 name = "common_transforms",
1884 ":AggressiveInstCombine",
1897 name = "asm_printer_defs",
1899 textual_hdrs = glob(["lib/CodeGen/AsmPrinter/*.def"]),
1903 name = "CodeGenTypes",
1905 "lib/CodeGenTypes/**/*.cpp",
1908 "include/llvm/CodeGenTypes/**/*.h",
1919 srcs = glob(["lib/CGData/**/*.cpp"]),
1921 "include/llvm/CGData/**/*.h",
1922 "include/llvm/CGData/**/*.inc",
1940 "lib/CodeGen/**/*.cpp",
1941 "lib/CodeGen/**/*.h",
1942 "lib/CodeGen/SelectionDAG/*.cpp",
1943 "lib/CodeGen/SelectionDAG/*.h",
1947 "include/llvm/LinkAllPasses.h",
1950 "include/llvm/CodeGen/**/*.h",
1954 textual_hdrs = glob([
1955 "include/llvm/CodeGen/**/*.def",
1958 ":AggressiveInstCombine",
1968 ":DebugInfoCodeView",
1984 ":asm_printer_defs",
1991 name = "MCDisassembler",
1993 "lib/MC/MCDisassembler/*.cpp",
1994 "lib/MC/MCDisassembler/*.h",
1997 "include/llvm/MC/MCDisassembler/*.h",
1999 "include/llvm-c/Disassembler.h",
2011 llvm_target_lib_list = [lib for lib in [
2014 "short_name": "AArch64",
2016 ("-gen-register-bank", "lib/Target/AArch64/AArch64GenRegisterBank.inc"),
2017 ("-gen-register-info", "lib/Target/AArch64/AArch64GenRegisterInfo.inc"),
2018 ("-gen-instr-info", "lib/Target/AArch64/AArch64GenInstrInfo.inc"),
2019 ("-gen-emitter", "lib/Target/AArch64/AArch64GenMCCodeEmitter.inc"),
2020 ("-gen-pseudo-lowering", "lib/Target/AArch64/AArch64GenMCPseudoLowering.inc"),
2021 ("-gen-asm-writer", "lib/Target/AArch64/AArch64GenAsmWriter.inc"),
2022 ("-gen-asm-writer -asmwriternum=1", "lib/Target/AArch64/AArch64GenAsmWriter1.inc"),
2023 ("-gen-asm-matcher", "lib/Target/AArch64/AArch64GenAsmMatcher.inc"),
2024 ("-gen-dag-isel", "lib/Target/AArch64/AArch64GenDAGISel.inc"),
2025 ("-gen-fast-isel", "lib/Target/AArch64/AArch64GenFastISel.inc"),
2026 ("-gen-global-isel", "lib/Target/AArch64/AArch64GenGlobalISel.inc"),
2027 ("-gen-global-isel-combiner -combiners=AArch64O0PreLegalizerCombiner", "lib/Target/AArch64/AArch64GenO0PreLegalizeGICombiner.inc"),
2028 ("-gen-global-isel-combiner -combiners=AArch64PreLegalizerCombiner", "lib/Target/AArch64/AArch64GenPreLegalizeGICombiner.inc"),
2029 ("-gen-global-isel-combiner -combiners=AArch64PostLegalizerCombiner", "lib/Target/AArch64/AArch64GenPostLegalizeGICombiner.inc"),
2030 ("-gen-global-isel-combiner -combiners=AArch64PostLegalizerLowering", "lib/Target/AArch64/AArch64GenPostLegalizeGILowering.inc"),
2031 ("-gen-callingconv", "lib/Target/AArch64/AArch64GenCallingConv.inc"),
2032 ("-gen-subtarget", "lib/Target/AArch64/AArch64GenSubtargetInfo.inc"),
2033 ("-gen-disassembler", "lib/Target/AArch64/AArch64GenDisassemblerTables.inc"),
2034 ("-gen-searchable-tables", "lib/Target/AArch64/AArch64GenSystemOperands.inc"),
2035 ("-gen-exegesis", "lib/Target/AArch64/AArch64GenExegesis.inc"),
2040 "short_name": "ARM",
2042 ("-gen-register-bank", "lib/Target/ARM/ARMGenRegisterBank.inc"),
2043 ("-gen-register-info", "lib/Target/ARM/ARMGenRegisterInfo.inc"),
2044 ("-gen-searchable-tables", "lib/Target/ARM/ARMGenSystemRegister.inc"),
2045 ("-gen-instr-info", "lib/Target/ARM/ARMGenInstrInfo.inc"),
2046 ("-gen-emitter", "lib/Target/ARM/ARMGenMCCodeEmitter.inc"),
2047 ("-gen-pseudo-lowering", "lib/Target/ARM/ARMGenMCPseudoLowering.inc"),
2048 ("-gen-asm-writer", "lib/Target/ARM/ARMGenAsmWriter.inc"),
2049 ("-gen-asm-matcher", "lib/Target/ARM/ARMGenAsmMatcher.inc"),
2050 ("-gen-dag-isel", "lib/Target/ARM/ARMGenDAGISel.inc"),
2051 ("-gen-fast-isel", "lib/Target/ARM/ARMGenFastISel.inc"),
2052 ("-gen-global-isel", "lib/Target/ARM/ARMGenGlobalISel.inc"),
2053 ("-gen-callingconv", "lib/Target/ARM/ARMGenCallingConv.inc"),
2054 ("-gen-subtarget", "lib/Target/ARM/ARMGenSubtargetInfo.inc"),
2055 ("-gen-disassembler", "lib/Target/ARM/ARMGenDisassemblerTables.inc"),
2060 "short_name": "AMDGPU",
2062 ("-gen-register-bank", "lib/Target/AMDGPU/AMDGPUGenRegisterBank.inc"),
2063 ("-gen-register-info", "lib/Target/AMDGPU/AMDGPUGenRegisterInfo.inc"),
2064 ("-gen-instr-info", "lib/Target/AMDGPU/AMDGPUGenInstrInfo.inc"),
2065 ("-gen-emitter", "lib/Target/AMDGPU/AMDGPUGenMCCodeEmitter.inc"),
2066 ("-gen-pseudo-lowering", "lib/Target/AMDGPU/AMDGPUGenMCPseudoLowering.inc"),
2067 ("-gen-asm-writer", "lib/Target/AMDGPU/AMDGPUGenAsmWriter.inc"),
2068 ("-gen-asm-matcher", "lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc"),
2069 ("-gen-dag-isel", "lib/Target/AMDGPU/AMDGPUGenDAGISel.inc"),
2070 ("-gen-callingconv", "lib/Target/AMDGPU/AMDGPUGenCallingConv.inc"),
2071 ("-gen-subtarget", "lib/Target/AMDGPU/AMDGPUGenSubtargetInfo.inc"),
2072 ("-gen-disassembler", "lib/Target/AMDGPU/AMDGPUGenDisassemblerTables.inc"),
2073 ("-gen-searchable-tables", "lib/Target/AMDGPU/AMDGPUGenSearchableTables.inc"),
2076 ":InstCombineTableGen",
2077 ":amdgpu_isel_target_gen",
2083 "short_name": "AVR",
2085 ("-gen-asm-matcher", "lib/Target/AVR/AVRGenAsmMatcher.inc"),
2086 ("-gen-asm-writer", "lib/Target/AVR/AVRGenAsmWriter.inc"),
2087 ("-gen-callingconv", "lib/Target/AVR/AVRGenCallingConv.inc"),
2088 ("-gen-dag-isel", "lib/Target/AVR/AVRGenDAGISel.inc"),
2089 ("-gen-disassembler", "lib/Target/AVR/AVRGenDisassemblerTables.inc"),
2090 ("-gen-emitter", "lib/Target/AVR/AVRGenMCCodeEmitter.inc"),
2091 ("-gen-instr-info", "lib/Target/AVR/AVRGenInstrInfo.inc"),
2092 ("-gen-register-info", "lib/Target/AVR/AVRGenRegisterInfo.inc"),
2093 ("-gen-subtarget", "lib/Target/AVR/AVRGenSubtargetInfo.inc"),
2098 "short_name": "BPF",
2100 ("-gen-register-bank", "lib/Target/BPF/BPFGenRegisterBank.inc"),
2101 ("-gen-asm-writer", "lib/Target/BPF/BPFGenAsmWriter.inc"),
2102 ("-gen-asm-matcher", "lib/Target/BPF/BPFGenAsmMatcher.inc"),
2103 ("-gen-callingconv", "lib/Target/BPF/BPFGenCallingConv.inc"),
2104 ("-gen-dag-isel", "lib/Target/BPF/BPFGenDAGISel.inc"),
2105 ("-gen-global-isel", "lib/Target/BPF/BPFGenGlobalISel.inc"),
2106 ("-gen-disassembler", "lib/Target/BPF/BPFGenDisassemblerTables.inc"),
2107 ("-gen-emitter", "lib/Target/BPF/BPFGenMCCodeEmitter.inc"),
2108 ("-gen-instr-info", "lib/Target/BPF/BPFGenInstrInfo.inc"),
2109 ("-gen-register-info", "lib/Target/BPF/BPFGenRegisterInfo.inc"),
2110 ("-gen-subtarget", "lib/Target/BPF/BPFGenSubtargetInfo.inc"),
2115 "short_name": "Hexagon",
2117 ("-gen-asm-matcher", "lib/Target/Hexagon/HexagonGenAsmMatcher.inc"),
2118 ("-gen-asm-writer", "lib/Target/Hexagon/HexagonGenAsmWriter.inc"),
2119 ("-gen-callingconv", "lib/Target/Hexagon/HexagonGenCallingConv.inc"),
2120 ("-gen-dag-isel", "lib/Target/Hexagon/HexagonGenDAGISel.inc"),
2121 ("-gen-dfa-packetizer", "lib/Target/Hexagon/HexagonGenDFAPacketizer.inc"),
2122 ("-gen-disassembler", "lib/Target/Hexagon/HexagonGenDisassemblerTables.inc"),
2123 ("-gen-instr-info", "lib/Target/Hexagon/HexagonGenInstrInfo.inc"),
2124 ("-gen-emitter", "lib/Target/Hexagon/HexagonGenMCCodeEmitter.inc"),
2125 ("-gen-register-info", "lib/Target/Hexagon/HexagonGenRegisterInfo.inc"),
2126 ("-gen-subtarget", "lib/Target/Hexagon/HexagonGenSubtargetInfo.inc"),
2131 "short_name": "Lanai",
2133 ("-gen-asm-matcher", "lib/Target/Lanai/LanaiGenAsmMatcher.inc"),
2134 ("-gen-asm-writer", "lib/Target/Lanai/LanaiGenAsmWriter.inc"),
2135 ("-gen-callingconv", "lib/Target/Lanai/LanaiGenCallingConv.inc"),
2136 ("-gen-dag-isel", "lib/Target/Lanai/LanaiGenDAGISel.inc"),
2137 ("-gen-disassembler", "lib/Target/Lanai/LanaiGenDisassemblerTables.inc"),
2138 ("-gen-emitter", "lib/Target/Lanai/LanaiGenMCCodeEmitter.inc"),
2139 ("-gen-instr-info", "lib/Target/Lanai/LanaiGenInstrInfo.inc"),
2140 ("-gen-register-info", "lib/Target/Lanai/LanaiGenRegisterInfo.inc"),
2141 ("-gen-subtarget", "lib/Target/Lanai/LanaiGenSubtargetInfo.inc"),
2145 "name": "LoongArch",
2146 "short_name": "LoongArch",
2148 ("-gen-asm-matcher", "lib/Target/LoongArch/LoongArchGenAsmMatcher.inc"),
2149 ("-gen-asm-writer", "lib/Target/LoongArch/LoongArchGenAsmWriter.inc"),
2150 ("-gen-dag-isel", "lib/Target/LoongArch/LoongArchGenDAGISel.inc"),
2151 ("-gen-disassembler", "lib/Target/LoongArch/LoongArchGenDisassemblerTables.inc"),
2152 ("-gen-emitter", "lib/Target/LoongArch/LoongArchGenMCCodeEmitter.inc"),
2153 ("-gen-instr-info", "lib/Target/LoongArch/LoongArchGenInstrInfo.inc"),
2154 ("-gen-pseudo-lowering", "lib/Target/LoongArch/LoongArchGenMCPseudoLowering.inc"),
2155 ("-gen-register-info", "lib/Target/LoongArch/LoongArchGenRegisterInfo.inc"),
2156 ("-gen-subtarget", "lib/Target/LoongArch/LoongArchGenSubtargetInfo.inc"),
2161 "short_name": "Mips",
2163 ("-gen-asm-matcher", "lib/Target/Mips/MipsGenAsmMatcher.inc"),
2164 ("-gen-asm-writer", "lib/Target/Mips/MipsGenAsmWriter.inc"),
2165 ("-gen-callingconv", "lib/Target/Mips/MipsGenCallingConv.inc"),
2166 ("-gen-dag-isel", "lib/Target/Mips/MipsGenDAGISel.inc"),
2167 ("-gen-disassembler", "lib/Target/Mips/MipsGenDisassemblerTables.inc"),
2168 ("-gen-emitter", "lib/Target/Mips/MipsGenMCCodeEmitter.inc"),
2169 ("-gen-exegesis", "lib/Target/Mips/MipsGenExegesis.inc"),
2170 ("-gen-fast-isel", "lib/Target/Mips/MipsGenFastISel.inc"),
2171 ("-gen-global-isel", "lib/Target/Mips/MipsGenGlobalISel.inc"),
2172 ("-gen-global-isel-combiner -combiners=MipsPostLegalizerCombiner", "lib/Target/Mips/MipsGenPostLegalizeGICombiner.inc"),
2173 ("-gen-instr-info", "lib/Target/Mips/MipsGenInstrInfo.inc"),
2174 ("-gen-pseudo-lowering", "lib/Target/Mips/MipsGenMCPseudoLowering.inc"),
2175 ("-gen-register-bank", "lib/Target/Mips/MipsGenRegisterBank.inc"),
2176 ("-gen-register-info", "lib/Target/Mips/MipsGenRegisterInfo.inc"),
2177 ("-gen-subtarget", "lib/Target/Mips/MipsGenSubtargetInfo.inc"),
2182 "short_name": "MSP430",
2184 ("-gen-asm-matcher", "lib/Target/MSP430/MSP430GenAsmMatcher.inc"),
2185 ("-gen-asm-writer", "lib/Target/MSP430/MSP430GenAsmWriter.inc"),
2186 ("-gen-callingconv", "lib/Target/MSP430/MSP430GenCallingConv.inc"),
2187 ("-gen-dag-isel", "lib/Target/MSP430/MSP430GenDAGISel.inc"),
2188 ("-gen-disassembler", "lib/Target/MSP430/MSP430GenDisassemblerTables.inc"),
2189 ("-gen-emitter", "lib/Target/MSP430/MSP430GenMCCodeEmitter.inc"),
2190 ("-gen-instr-info", "lib/Target/MSP430/MSP430GenInstrInfo.inc"),
2191 ("-gen-register-info", "lib/Target/MSP430/MSP430GenRegisterInfo.inc"),
2192 ("-gen-subtarget", "lib/Target/MSP430/MSP430GenSubtargetInfo.inc"),
2197 "short_name": "NVPTX",
2199 ("-gen-register-info", "lib/Target/NVPTX/NVPTXGenRegisterInfo.inc"),
2200 ("-gen-instr-info", "lib/Target/NVPTX/NVPTXGenInstrInfo.inc"),
2201 ("-gen-asm-writer", "lib/Target/NVPTX/NVPTXGenAsmWriter.inc"),
2202 ("-gen-dag-isel", "lib/Target/NVPTX/NVPTXGenDAGISel.inc"),
2203 ("-gen-subtarget", "lib/Target/NVPTX/NVPTXGenSubtargetInfo.inc"),
2208 "short_name": "PPC",
2210 ("-gen-asm-writer", "lib/Target/PowerPC/PPCGenAsmWriter.inc"),
2211 ("-gen-asm-matcher", "lib/Target/PowerPC/PPCGenAsmMatcher.inc"),
2212 ("-gen-emitter", "lib/Target/PowerPC/PPCGenMCCodeEmitter.inc"),
2213 ("-gen-register-info", "lib/Target/PowerPC/PPCGenRegisterInfo.inc"),
2214 ("-gen-instr-info", "lib/Target/PowerPC/PPCGenInstrInfo.inc"),
2215 ("-gen-dag-isel", "lib/Target/PowerPC/PPCGenDAGISel.inc"),
2216 ("-gen-fast-isel", "lib/Target/PowerPC/PPCGenFastISel.inc"),
2217 ("-gen-callingconv", "lib/Target/PowerPC/PPCGenCallingConv.inc"),
2218 ("-gen-subtarget", "lib/Target/PowerPC/PPCGenSubtargetInfo.inc"),
2219 ("-gen-disassembler", "lib/Target/PowerPC/PPCGenDisassemblerTables.inc"),
2220 ("-gen-register-bank", "lib/Target/PowerPC/PPCGenRegisterBank.inc"),
2221 ("-gen-global-isel", "lib/Target/PowerPC/PPCGenGlobalISel.inc"),
2222 ("-gen-exegesis", "lib/Target/PowerPC/PPCGenExegesis.inc"),
2227 "short_name": "RISCV",
2229 ("-gen-asm-matcher", "lib/Target/RISCV/RISCVGenAsmMatcher.inc"),
2230 ("-gen-asm-writer", "lib/Target/RISCV/RISCVGenAsmWriter.inc"),
2231 ("-gen-compress-inst-emitter", "lib/Target/RISCV/RISCVGenCompressInstEmitter.inc"),
2232 ("-gen-dag-isel", "lib/Target/RISCV/RISCVGenDAGISel.inc"),
2233 ("-gen-disassembler", "lib/Target/RISCV/RISCVGenDisassemblerTables.inc"),
2234 ("-gen-instr-info", "lib/Target/RISCV/RISCVGenInstrInfo.inc"),
2235 ("-gen-macro-fusion-pred", "lib/Target/RISCV/RISCVGenMacroFusion.inc"),
2236 ("-gen-emitter", "lib/Target/RISCV/RISCVGenMCCodeEmitter.inc"),
2237 ("-gen-pseudo-lowering", "lib/Target/RISCV/RISCVGenMCPseudoLowering.inc"),
2238 ("-gen-register-bank", "lib/Target/RISCV/RISCVGenRegisterBank.inc"),
2239 ("-gen-register-info", "lib/Target/RISCV/RISCVGenRegisterInfo.inc"),
2240 ("-gen-subtarget", "lib/Target/RISCV/RISCVGenSubtargetInfo.inc"),
2241 ("-gen-searchable-tables", "lib/Target/RISCV/RISCVGenSearchableTables.inc"),
2242 ("-gen-exegesis", "lib/Target/RISCV/RISCVGenExegesis.inc"),
2245 ":riscv_isel_target_gen",
2250 "short_name": "Sparc",
2252 ("-gen-asm-writer", "lib/Target/Sparc/SparcGenAsmWriter.inc"),
2253 ("-gen-asm-matcher", "lib/Target/Sparc/SparcGenAsmMatcher.inc"),
2254 ("-gen-emitter", "lib/Target/Sparc/SparcGenMCCodeEmitter.inc"),
2255 ("-gen-register-info", "lib/Target/Sparc/SparcGenRegisterInfo.inc"),
2256 ("-gen-instr-info", "lib/Target/Sparc/SparcGenInstrInfo.inc"),
2257 ("-gen-dag-isel", "lib/Target/Sparc/SparcGenDAGISel.inc"),
2258 ("-gen-callingconv", "lib/Target/Sparc/SparcGenCallingConv.inc"),
2259 ("-gen-subtarget", "lib/Target/Sparc/SparcGenSubtargetInfo.inc"),
2260 ("-gen-disassembler", "lib/Target/Sparc/SparcGenDisassemblerTables.inc"),
2261 ("-gen-searchable-tables", "lib/Target/Sparc/SparcGenSearchableTables.inc"),
2266 "short_name": "SPIRV",
2268 ("-gen-asm-writer", "lib/Target/SPIRV/SPIRVGenAsmWriter.inc"),
2269 ("-gen-emitter", "lib/Target/SPIRV/SPIRVGenMCCodeEmitter.inc"),
2270 ("-gen-global-isel", "lib/Target/SPIRV/SPIRVGenGlobalISel.inc"),
2271 ("-gen-global-isel-combiner -combiners=SPIRVPreLegalizerCombiner", "lib/Target/SPIRV/SPIRVGenPreLegalizeGICombiner.inc"),
2272 ("-gen-instr-info", "lib/Target/SPIRV/SPIRVGenInstrInfo.inc"),
2273 ("-gen-register-bank", "lib/Target/SPIRV/SPIRVGenRegisterBank.inc"),
2274 ("-gen-register-info", "lib/Target/SPIRV/SPIRVGenRegisterInfo.inc"),
2275 ("-gen-searchable-tables", "lib/Target/SPIRV/SPIRVGenTables.inc"),
2276 ("-gen-subtarget", "lib/Target/SPIRV/SPIRVGenSubtargetInfo.inc"),
2281 "short_name": "SystemZ",
2283 ("-gen-asm-matcher", "lib/Target/SystemZ/SystemZGenAsmMatcher.inc"),
2284 ("-gen-asm-writer", "lib/Target/SystemZ/SystemZGenGNUAsmWriter.inc"),
2285 ("-gen-asm-writer -asmwriternum=1", "lib/Target/SystemZ/SystemZGenHLASMAsmWriter.inc"),
2286 ("-gen-callingconv", "lib/Target/SystemZ/SystemZGenCallingConv.inc"),
2287 ("-gen-dag-isel", "lib/Target/SystemZ/SystemZGenDAGISel.inc"),
2288 ("-gen-disassembler", "lib/Target/SystemZ/SystemZGenDisassemblerTables.inc"),
2289 ("-gen-emitter", "lib/Target/SystemZ/SystemZGenMCCodeEmitter.inc"),
2290 ("-gen-instr-info", "lib/Target/SystemZ/SystemZGenInstrInfo.inc"),
2291 ("-gen-register-info", "lib/Target/SystemZ/SystemZGenRegisterInfo.inc"),
2292 ("-gen-subtarget", "lib/Target/SystemZ/SystemZGenSubtargetInfo.inc"),
2299 ("-gen-asm-matcher", "lib/Target/VE/VEGenAsmMatcher.inc"),
2300 ("-gen-asm-writer", "lib/Target/VE/VEGenAsmWriter.inc"),
2301 ("-gen-callingconv", "lib/Target/VE/VEGenCallingConv.inc"),
2302 ("-gen-dag-isel", "lib/Target/VE/VEGenDAGISel.inc"),
2303 ("-gen-disassembler", "lib/Target/VE/VEGenDisassemblerTables.inc"),
2304 ("-gen-emitter", "lib/Target/VE/VEGenMCCodeEmitter.inc"),
2305 ("-gen-instr-info", "lib/Target/VE/VEGenInstrInfo.inc"),
2306 ("-gen-register-info", "lib/Target/VE/VEGenRegisterInfo.inc"),
2307 ("-gen-subtarget", "lib/Target/VE/VEGenSubtargetInfo.inc"),
2311 "name": "WebAssembly",
2312 "short_name": "WebAssembly",
2314 ("-gen-disassembler", "lib/Target/WebAssembly/WebAssemblyGenDisassemblerTables.inc"),
2315 ("-gen-asm-writer", "lib/Target/WebAssembly/WebAssemblyGenAsmWriter.inc"),
2316 ("-gen-instr-info", "lib/Target/WebAssembly/WebAssemblyGenInstrInfo.inc"),
2317 ("-gen-dag-isel", "lib/Target/WebAssembly/WebAssemblyGenDAGISel.inc"),
2318 ("-gen-fast-isel", "lib/Target/WebAssembly/WebAssemblyGenFastISel.inc"),
2319 ("-gen-emitter", "lib/Target/WebAssembly/WebAssemblyGenMCCodeEmitter.inc"),
2320 ("-gen-register-info", "lib/Target/WebAssembly/WebAssemblyGenRegisterInfo.inc"),
2321 ("-gen-subtarget", "lib/Target/WebAssembly/WebAssemblyGenSubtargetInfo.inc"),
2322 ("-gen-asm-matcher", "lib/Target/WebAssembly/WebAssemblyGenAsmMatcher.inc"),
2327 "short_name": "X86",
2329 ("-gen-register-bank", "lib/Target/X86/X86GenRegisterBank.inc"),
2330 ("-gen-register-info", "lib/Target/X86/X86GenRegisterInfo.inc"),
2331 ("-gen-disassembler", "lib/Target/X86/X86GenDisassemblerTables.inc"),
2332 ("-gen-instr-info", "lib/Target/X86/X86GenInstrInfo.inc"),
2333 ("-gen-asm-writer", "lib/Target/X86/X86GenAsmWriter.inc"),
2334 ("-gen-asm-writer -asmwriternum=1", "lib/Target/X86/X86GenAsmWriter1.inc"),
2335 ("-gen-asm-matcher", "lib/Target/X86/X86GenAsmMatcher.inc"),
2336 ("-gen-dag-isel", "lib/Target/X86/X86GenDAGISel.inc"),
2337 ("-gen-fast-isel", "lib/Target/X86/X86GenFastISel.inc"),
2338 ("-gen-global-isel", "lib/Target/X86/X86GenGlobalISel.inc"),
2339 ("-gen-callingconv", "lib/Target/X86/X86GenCallingConv.inc"),
2340 ("-gen-subtarget", "lib/Target/X86/X86GenSubtargetInfo.inc"),
2341 ("-gen-x86-fold-tables -asmwriternum=1", "lib/Target/X86/X86GenFoldTables.inc"),
2342 ("-gen-x86-instr-mapping", "lib/Target/X86/X86GenInstrMapping.inc"),
2343 ("-gen-exegesis", "lib/Target/X86/X86GenExegesis.inc"),
2344 ("-gen-x86-mnemonic-tables -asmwriternum=1", "lib/Target/X86/X86GenMnemonicTables.inc"),
2349 "short_name": "XCore",
2351 ("-gen-asm-writer", "lib/Target/XCore/XCoreGenAsmWriter.inc"),
2352 ("-gen-callingconv", "lib/Target/XCore/XCoreGenCallingConv.inc"),
2353 ("-gen-dag-isel", "lib/Target/XCore/XCoreGenDAGISel.inc"),
2354 ("-gen-disassembler", "lib/Target/XCore/XCoreGenDisassemblerTables.inc"),
2355 ("-gen-instr-info", "lib/Target/XCore/XCoreGenInstrInfo.inc"),
2356 ("-gen-register-info", "lib/Target/XCore/XCoreGenRegisterInfo.inc"),
2357 ("-gen-subtarget", "lib/Target/XCore/XCoreGenSubtargetInfo.inc"),
2360 ] if lib["name"] in llvm_targets]
2363 name = "x86_target_layering_problem_hdrs",
2364 textual_hdrs = ["lib/Target/X86/X86InstrInfo.h"],
2368 name = "amdgpu_isel_target_gen",
2369 strip_include_prefix = "lib/Target/AMDGPU",
2371 ("-gen-global-isel", "lib/Target/AMDGPU/AMDGPUGenGlobalISel.inc"),
2372 ("-gen-global-isel-combiner -combiners=AMDGPUPreLegalizerCombiner", "lib/Target/AMDGPU/AMDGPUGenPreLegalizeGICombiner.inc"),
2373 ("-gen-global-isel-combiner -combiners=AMDGPUPostLegalizerCombiner", "lib/Target/AMDGPU/AMDGPUGenPostLegalizeGICombiner.inc"),
2374 ("-gen-global-isel-combiner -combiners=AMDGPURegBankCombiner", "lib/Target/AMDGPU/AMDGPUGenRegBankGICombiner.inc"),
2376 tblgen = ":llvm-tblgen",
2377 td_file = "lib/Target/AMDGPU/AMDGPUGISel.td",
2379 ":common_target_td_sources",
2381 "lib/Target/AMDGPU/*.td",
2386 name = "r600_target_gen",
2387 strip_include_prefix = "lib/Target/AMDGPU",
2389 ("-gen-asm-writer", "lib/Target/AMDGPU/R600GenAsmWriter.inc"),
2390 ("-gen-callingconv", "lib/Target/AMDGPU/R600GenCallingConv.inc"),
2391 ("-gen-dag-isel", "lib/Target/AMDGPU/R600GenDAGISel.inc"),
2392 ("-gen-dfa-packetizer", "lib/Target/AMDGPU/R600GenDFAPacketizer.inc"),
2393 ("-gen-instr-info", "lib/Target/AMDGPU/R600GenInstrInfo.inc"),
2394 ("-gen-emitter", "lib/Target/AMDGPU/R600GenMCCodeEmitter.inc"),
2395 ("-gen-register-info", "lib/Target/AMDGPU/R600GenRegisterInfo.inc"),
2396 ("-gen-subtarget", "lib/Target/AMDGPU/R600GenSubtargetInfo.inc"),
2398 tblgen = ":llvm-tblgen",
2399 td_file = "lib/Target/AMDGPU/R600.td",
2401 ":common_target_td_sources",
2403 "lib/Target/AMDGPU/*.td",
2408 name = "riscv_isel_target_gen",
2409 strip_include_prefix = "lib/Target/RISCV",
2411 ("-gen-global-isel", "lib/Target/RISCV/RISCVGenGlobalISel.inc"),
2412 ("-gen-global-isel-combiner -combiners=RISCVO0PreLegalizerCombiner", "lib/Target/RISCV/RISCVGenO0PreLegalizeGICombiner.inc"),
2413 ("-gen-global-isel-combiner -combiners=RISCVPostLegalizerCombiner", "lib/Target/RISCV/RISCVGenPostLegalizeGICombiner.inc"),
2414 ("-gen-global-isel-combiner -combiners=RISCVPreLegalizerCombiner", "lib/Target/RISCV/RISCVGenPreLegalizeGICombiner.inc"),
2416 tblgen = ":llvm-tblgen",
2417 td_file = "lib/Target/RISCV/RISCVGISel.td",
2419 ":common_target_td_sources",
2421 "lib/Target/RISCV/**/*.td",
2427 name = target["name"] + "CommonTableGen",
2428 strip_include_prefix = "lib/Target/" + target["name"],
2429 tbl_outs = target["tbl_outs"],
2430 tblgen = ":llvm-tblgen",
2431 # MSVC isn't happy with long string literals, while other compilers
2432 # which support them get significant compile time improvements with
2433 # them enabled. Ideally this flag would only be enabled on Windows via
2434 # a select() on `@platforms//os:windows,`, but that would
2435 # require refactoring gentbl from a macro into a rule.
2436 # TODO(#92): Refactor gentbl to support this use
2437 tblgen_args = "--long-string-literals=0",
2438 td_file = "lib/Target/" + target["name"] + "/" + target["short_name"] + ".td",
2440 ":common_target_td_sources",
2443 "lib/Target/" + target["name"] + "/*.td",
2444 "lib/Target/" + target["name"] + "/GISel/*.td",
2448 deps = target.get("tbl_deps", []),
2451 name = target["name"] + "Info",
2452 srcs = ["lib/Target/" + target["name"] + "/TargetInfo/" + target["name"] + "TargetInfo.cpp"],
2453 hdrs = glob(["lib/Target/" + target["name"] + "/TargetInfo/*.h"]),
2455 # Workaround for https://github.com/bazelbuild/bazel/issues/3828
2456 # TODO(gcmn): Remove this when upgrading to a Bazel version containing
2457 # https://github.com/bazelbuild/bazel/commit/e3b7e17b05f1
2458 includes = ["lib/Target/" + target["name"]],
2459 strip_include_prefix = "lib/Target/" + target["name"],
2461 ":" + target["name"] + "CommonTableGen",
2467 # We cannot separate the `Utils` and `MCTargetDesc` sublibraries of
2468 # a number of targets due to crisscrossing inclusion of headers.
2470 name = target["name"] + "UtilsAndDesc",
2473 "lib/Target/" + target["name"] + "/MCTargetDesc/*.cpp",
2474 "lib/Target/" + target["name"] + "/Utils/*.cpp",
2476 # We have to include these headers here as well as in the `hdrs`
2477 # below to allow the `.cpp` files to use file-relative-inclusion to
2478 # find them, even though consumers of this library use inclusion
2479 # relative to the target with the `strip_includes_prefix` of this
2480 # library. This mixture is likely incompatible with header modules.
2481 "lib/Target/" + target["name"] + "/MCTargetDesc/*.h",
2482 "lib/Target/" + target["name"] + "/Utils/*.h",
2488 "lib/Target/" + target["name"] + "/MCTargetDesc/*.h",
2489 "lib/Target/" + target["name"] + "/Utils/*.h",
2491 # This a bit of a hack to allow us to expose common, internal
2492 # target header files to other libraries within the target via
2493 # target-relative includes. This usage of headers is inherently
2494 # non-modular as there is a mixture of target-relative inclusion
2495 # using this rule and file-relative inclusion using the repeated
2496 # listing of these headers in the `srcs` of subsequent rules.
2497 "lib/Target/" + target["name"] + "/*.h",
2499 # FIXME: The entries below should be `textual_hdrs` instead of
2500 # `hdrs`, but unfortunately that doesn't work with
2501 # `strip_include_prefix`:
2502 # https://github.com/bazelbuild/bazel/issues/12424
2504 # Once that issue is fixed and released, we can switch this to
2505 # `textual_hdrs` and remove the feature disabling the various Bazel
2506 # features (both current and under-development) that motivated the
2507 # distinction between these two.
2508 "lib/Target/" + target["name"] + "/*.def",
2509 "lib/Target/" + target["name"] + "/*.inc",
2510 "lib/Target/" + target["name"] + "/MCTargetDesc/*.def",
2520 strip_include_prefix = "lib/Target/" + target["name"],
2526 ":DebugInfoCodeView",
2532 ":" + target["name"] + "CommonTableGen",
2533 ":" + target["name"] + "Info",
2537 name = target["name"] + "CodeGen",
2540 "lib/Target/" + target["name"] + "/GISel/*.cpp",
2541 "lib/Target/" + target["name"] + "/GISel/*.h",
2542 "lib/Target/" + target["name"] + "/*.cpp",
2543 "lib/Target/" + target["name"] + "/*.h",
2547 hdrs = ["lib/Target/" + target["name"] + "/" + target["short_name"] + ".h"],
2549 features = ["-layering_check"],
2550 strip_include_prefix = "lib/Target/" + target["name"],
2551 textual_hdrs = glob(
2553 "lib/Target/" + target["name"] + "/*.def",
2554 "lib/Target/" + target["name"] + "/*.inc",
2567 ":Passes", # TODO(chandlerc): Likely a layering violation.
2575 ":" + target["name"] + "Analysis",
2576 ":" + target["name"] + "CommonTableGen",
2577 ":" + target["name"] + "Info",
2578 ":" + target["name"] + "UtilsAndDesc",
2582 name = target["name"] + "AsmParser",
2585 "lib/Target/" + target["name"] + "/AsmParser/*.cpp",
2586 "lib/Target/" + target["name"] + "/AsmParser/*.h",
2599 ":" + target["name"] + "CodeGen",
2600 ":" + target["name"] + "CommonTableGen",
2601 ":" + target["name"] + "Info",
2602 ":" + target["name"] + "UtilsAndDesc",
2605 # This target is a bit of a hack to allow us to expose internal
2606 # disassembler header files via internal target-relative include paths.
2607 # This usage of headers is inherently non-modular as there is a mixture of
2608 # target-relative inclusion using this rule and same-directory inclusion
2609 # using the repeated listing of these headers in the `srcs` below.
2611 name = target["name"] + "DisassemblerInternalHeaders",
2612 # FIXME: This should be `textual_hdrs` instead of `hdrs`, but
2613 # unfortunately that doesn't work with `strip_include_prefix`:
2614 # https://github.com/bazelbuild/bazel/issues/12424
2616 # Once that issue is fixed and released, we can switch this to
2617 # `textual_hdrs` and remove the feature disabling the various Bazel
2618 # features (both current and under-development) that motivated the
2619 # distinction between these two.
2622 "lib/Target/" + target["name"] + "/Disassembler/*.h",
2630 strip_include_prefix = "lib/Target/" + target["name"],
2633 name = target["name"] + "Disassembler",
2636 "lib/Target/" + target["name"] + "/Disassembler/*.cpp",
2637 "lib/Target/" + target["name"] + "/Disassembler/*.c",
2638 "lib/Target/" + target["name"] + "/Disassembler/*.h",
2643 features = ["-layering_check"],
2651 ":" + target["name"] + "CodeGen",
2652 ":" + target["name"] + "DisassemblerInternalHeaders",
2653 ":" + target["name"] + "CommonTableGen",
2654 ":" + target["name"] + "UtilsAndDesc",
2658 name = target["name"] + "TargetMCA",
2661 "lib/Target/" + target["name"] + "/MCA/*.cpp",
2662 "lib/Target/" + target["name"] + "/MCA/*.c",
2663 "lib/Target/" + target["name"] + "/MCA/*.h",
2668 features = ["-layering_check"],
2675 ":" + target["name"] + "DisassemblerInternalHeaders",
2676 ":" + target["name"] + "Info",
2677 ":" + target["name"] + "UtilsAndDesc",
2681 name = target["name"] + "Analysis",
2684 "lib/Target/" + target["name"] + "/Analysis/*.cpp",
2685 "lib/Target/" + target["name"] + "/Analysis/*.h",
2690 features = ["-layering_check"],
2698 ] for target in llvm_target_lib_list]
2701 name = "AllTargetsCodeGens",
2704 target["name"] + "CodeGen"
2705 for target in llvm_target_lib_list
2710 name = "AllTargetsAsmParsers",
2713 target["name"] + "AsmParser"
2714 for target in llvm_target_lib_list
2719 name = "AllTargetsDisassemblers",
2722 target["name"] + "Disassembler"
2723 for target in llvm_target_lib_list
2728 name = "AllTargetsMCAs",
2731 target["name"] + "TargetMCA"
2732 for target in llvm_target_lib_list
2737 name = "pass_registry_def",
2739 textual_hdrs = ["lib/Passes/PassRegistry.def"],
2748 "include/llvm/Passes/*.h",
2749 "include/llvm/Passes/*.def",
2750 "include/llvm/Passes/*.inc",
2751 ]) + ["include/llvm-c/Transforms/PassBuilder.h"],
2754 ":AggressiveInstCombine",
2772 ":common_transforms",
2774 ":pass_registry_def",
2784 "include/llvm/LTO/*.h",
2785 "include/llvm/LTO/legacy/*.h",
2787 "include/llvm-c/lto.h",
2813 ":common_transforms",
2819 name = "ExecutionEngine",
2821 "lib/ExecutionEngine/*.cpp",
2822 "lib/ExecutionEngine/RuntimeDyld/*.cpp",
2823 "lib/ExecutionEngine/RuntimeDyld/*.h",
2824 "lib/ExecutionEngine/RuntimeDyld/Targets/*.cpp",
2825 "lib/ExecutionEngine/RuntimeDyld/Targets/*.h",
2829 "include/llvm/ExecutionEngine/*.h",
2832 "include/llvm/ExecutionEngine/MCJIT*.h",
2833 "include/llvm/ExecutionEngine/OProfileWrapper.h",
2836 "include/llvm-c/ExecutionEngine.h",
2848 ":OrcTargetProcess",
2858 name = "Interpreter",
2860 "lib/ExecutionEngine/Interpreter/*.cpp",
2861 "lib/ExecutionEngine/Interpreter/*.h",
2863 hdrs = ["include/llvm/ExecutionEngine/Interpreter.h"],
2876 name = "JITLinkTableGen",
2877 strip_include_prefix = "lib/ExecutionEngine/JITLink",
2879 "-gen-opt-parser-defs",
2880 "lib/ExecutionEngine/JITLink/COFFOptions.inc",
2882 tblgen = ":llvm-tblgen",
2883 td_file = "lib/ExecutionEngine/JITLink/COFFOptions.td",
2884 td_srcs = ["include/llvm/Option/OptParser.td"],
2890 "lib/ExecutionEngine/JITLink/*.cpp",
2891 "lib/ExecutionEngine/JITLink/*.h",
2894 "include/llvm/ExecutionEngine/JITLink/*.h",
2895 "include/llvm/ExecutionEngine/Orc/*.h",
2905 ":OrcTargetProcess",
2915 "lib/ExecutionEngine/MCJIT/*.cpp",
2916 "lib/ExecutionEngine/MCJIT/*.h",
2918 hdrs = glob(["include/llvm/ExecutionEngine/MCJIT*.h"]),
2935 "lib/ExecutionEngine/Orc/*.cpp",
2938 "include/llvm/ExecutionEngine/Orc/*.h",
2940 "include/llvm-c/LLJIT.h",
2941 "include/llvm-c/Orc.h",
2942 "include/llvm-c/OrcEE.h",
2946 "@platforms//os:android": [],
2947 "@platforms//os:windows": [],
2948 "@platforms//os:freebsd": [],
2949 "@platforms//os:macos": [],
2950 "//conditions:default": [
2967 ":OrcTargetProcess",
2981 "lib/ExecutionEngine/Orc/Shared/*.cpp",
2984 "include/llvm/ExecutionEngine/Orc/Shared/*.h",
2986 "include/llvm/ExecutionEngine/Orc/SymbolStringPool.h",
3005 name = "OrcDebugging",
3007 "lib/ExecutionEngine/Orc/Debugging/*.cpp",
3010 "include/llvm/ExecutionEngine/Orc/Debugging/*.h",
3011 ]) + ["include/llvm-c/LLJITUtils.h"],
3025 name = "OrcTargetProcess",
3027 "lib/ExecutionEngine/Orc/TargetProcess/*.cpp",
3028 "lib/ExecutionEngine/Orc/TargetProcess/*.h",
3031 "include/llvm/ExecutionEngine/Orc/TargetProcess/*.h",
3035 "@platforms//os:android": [],
3036 "@platforms//os:windows": [],
3037 "@platforms//os:freebsd": [],
3038 "@platforms//os:macos": [],
3039 "//conditions:default": [
3061 name = "DWARFLinker",
3063 "lib/DWARFLinker/Classic/*.cpp",
3065 hdrs = glob(["include/llvm/DWARFLinker/Classic/*.h"]),
3081 name = "DWARFLinkerBase",
3083 "lib/DWARFLinker/*.cpp",
3085 hdrs = glob(["include/llvm/DWARFLinker/*.h"]),
3097 name = "DWARFLinkerParallel",
3099 "lib/DWARFLinker/Parallel/*.cpp",
3100 "lib/DWARFLinker/Parallel/*.h",
3102 hdrs = glob(["include/llvm/DWARFLinker/Parallel/*.h"]),
3118 name = "DllOptionsTableGen",
3119 strip_include_prefix = "lib/ToolDrivers/llvm-dlltool",
3121 "-gen-opt-parser-defs",
3122 "lib/ToolDrivers/llvm-dlltool/Options.inc",
3124 tblgen = ":llvm-tblgen",
3125 td_file = "lib/ToolDrivers/llvm-dlltool/Options.td",
3126 td_srcs = ["include/llvm/Option/OptParser.td"],
3130 name = "DlltoolDriver",
3131 srcs = glob(["lib/ToolDrivers/llvm-dlltool/*.cpp"]),
3132 hdrs = glob(["include/llvm/ToolDrivers/llvm-dlltool/*.h"]),
3135 ":DllOptionsTableGen",
3144 name = "LibOptionsTableGen",
3145 strip_include_prefix = "lib/ToolDrivers/llvm-lib",
3147 "-gen-opt-parser-defs",
3148 "lib/ToolDrivers/llvm-lib/Options.inc",
3150 tblgen = ":llvm-tblgen",
3151 td_file = "lib/ToolDrivers/llvm-lib/Options.td",
3152 td_srcs = ["include/llvm/Option/OptParser.td"],
3157 srcs = glob(["lib/ToolDrivers/llvm-lib/*.cpp"]),
3158 hdrs = glob(["include/llvm/ToolDrivers/llvm-lib/*.h"]),
3163 ":LibOptionsTableGen",
3171 name = "InterfaceStub",
3173 "lib/InterfaceStub/*.cpp",
3176 "include/llvm/InterfaceStub/*.h",
3190 name = "WindowsDriver",
3192 "lib/WindowsDriver/*.cpp",
3195 "include/llvm/WindowsDriver/*.h",
3206 name = "WindowsManifest",
3208 "lib/WindowsManifest/*.cpp",
3211 "include/llvm/WindowsManifest/*.h",
3226 "include/llvm/MCA/**/*.h",
3238 name = "MCAApplication",
3240 "tools/llvm-mca/Views/*.cpp",
3243 for mca_source in glob(["tools/llvm-mca/*.cpp"])
3244 if mca_source != "tools/llvm-mca/llvm-mca.cpp"
3247 "tools/llvm-mca/*.h",
3248 "tools/llvm-mca/Views/*.h",
3250 strip_include_prefix = "tools/llvm-mca",
3265 hdrs = glob(["include/llvm/XRay/*.h"]),
3274 # A flag to pick which `pfm` to use for Exegesis.
3275 # Usage: `--@llvm-project//llvm:pfm=<disable|external|system>`.
3276 # Flag documentation: https://bazel.build/extending/config
3279 build_setting_default = "external",
3281 "disable", # Don't include pfm at all
3282 "external", # Build pfm from source
3283 "system", # Use system pfm (non hermetic)
3288 name = "pfm_disable",
3289 flag_values = {":pfm": "disable"},
3293 name = "pfm_external",
3294 flag_values = {":pfm": "external"},
3298 name = "pfm_system",
3299 flag_values = {":pfm": "system"},
3304 # We want dependencies of this library to have -DHAVE_LIBPFM conditionally
3305 # defined, so we set `defines` instead of `copts`.
3307 ":pfm_external": ["HAVE_LIBPFM=1"],
3308 ":pfm_system": ["HAVE_LIBPFM=1"],
3309 "//conditions:default": [],
3312 ":pfm_external": ["@pfm//:pfm_external"],
3313 ":pfm_system": ["@pfm//:pfm_system"],
3314 "//conditions:default": [],
3322 "tools/llvm-exegesis/lib/*.cpp",
3323 # We have to include these headers here as well as in the `hdrs` below
3324 # to allow the `.cpp` files to use file-relative-inclusion to find
3325 # them, even though consumers of this library use inclusion relative to
3326 # `tools/llvm-exegesis/lib` with the `strip_includes_prefix` of this
3327 # library. This mixture appears to be incompatible with header modules.
3328 "tools/llvm-exegesis/lib/*.h",
3330 "tools/llvm-exegesis/lib/{}/*.cpp".format(t)
3331 for t in llvm_target_exegesis
3333 "tools/llvm-exegesis/lib/{}/*.h".format(t)
3334 for t in llvm_target_exegesis
3338 hdrs = glob(["tools/llvm-exegesis/lib/*.h"]),
3344 strip_include_prefix = "tools/llvm-exegesis/lib",
3346 ":AllTargetsAsmParsers",
3347 ":AllTargetsCodeGens",
3362 "@platforms//os:linux": [":maybe_pfm"],
3363 "//conditions:default": [],
3367 ################################################################################
3368 # LLVM toolchain and development binaries
3371 name = "DsymutilTableGen",
3372 strip_include_prefix = "tools/dsymutil",
3374 "-gen-opt-parser-defs",
3375 "tools/dsymutil/Options.inc",
3377 tblgen = ":llvm-tblgen",
3378 td_file = "tools/dsymutil/Options.td",
3379 td_srcs = ["include/llvm/Option/OptParser.td"],
3383 name = "dsymutil-lib",
3385 "tools/dsymutil/*.cpp",
3386 "tools/dsymutil/*.h",
3390 ":AllTargetsCodeGens",
3395 ":DWARFLinkerParallel",
3398 ":DsymutilTableGen",
3411 llvm_driver_cc_binary(
3414 deps = [":dsymutil-lib"],
3426 ":AllTargetsAsmParsers",
3427 ":AllTargetsCodeGens",
3454 # ll scripts rely on symbols from dependent
3455 # libraries being resolvable.
3457 "@platforms//os:windows": [],
3458 "@platforms//os:macos": [],
3459 "//conditions:default": [
3460 "-Wl,--undefined=_ZTIi",
3461 "-Wl,--export-dynamic-symbol=_ZTIi",
3462 "-Wl,--export-dynamic-symbol=__cxa_begin_catch",
3463 "-Wl,--export-dynamic-symbol=__cxa_end_catch",
3464 "-Wl,--export-dynamic-symbol=__gxx_personality_v0",
3465 "-Wl,--export-dynamic-symbol=__cxa_allocate_exception",
3466 "-Wl,--export-dynamic-symbol=__cxa_throw",
3467 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBWrapper",
3468 "-Wl,--export-dynamic-symbol=llvm_orc_registerEHFrameSectionWrapper",
3469 "-Wl,--export-dynamic-symbol=llvm_orc_deregisterEHFrameSectionWrapper",
3474 ":AllTargetsAsmParsers",
3475 ":AllTargetsCodeGens",
3489 ":OrcTargetProcess",
3497 name = "llvm-ar-lib",
3498 srcs = glob(["tools/llvm-ar/*.cpp"]),
3501 ":AllTargetsAsmParsers",
3502 ":AllTargetsCodeGens",
3513 llvm_driver_cc_binary(
3516 deps = [":llvm-ar-lib"],
3519 # We need to run llvm-ar with different basenames to make it run with
3520 # different behavior.
3522 name = "llvm-dlltool",
3523 binary = ":llvm-ar",
3528 binary = ":llvm-ar",
3532 name = "llvm-ranlib",
3533 binary = ":llvm-ar",
3539 "tools/llvm-as/*.cpp",
3553 name = "llvm-bcanalyzer",
3555 "tools/llvm-bcanalyzer/*.cpp",
3568 "tools/llvm-cat/*.cpp",
3583 name = "CGDataOptsTableGen",
3584 strip_include_prefix = "tools/llvm-cgdata",
3586 "-gen-opt-parser-defs",
3587 "tools/llvm-cgdata/Opts.inc",
3589 tblgen = ":llvm-tblgen",
3590 td_file = "tools/llvm-cgdata/Opts.td",
3591 td_srcs = ["include/llvm/Option/OptParser.td"],
3595 name = "llvm-cgdata-lib",
3596 srcs = glob(["tools/llvm-cgdata/*.cpp"]),
3600 ":CGDataOptsTableGen",
3609 llvm_driver_cc_binary(
3610 name = "llvm-cgdata",
3612 deps = [":llvm-cgdata-lib"],
3616 name = "llvm-cfi-verify",
3618 "tools/llvm-cfi-verify/*.cpp",
3619 "tools/llvm-cfi-verify/lib/*.cpp",
3620 "tools/llvm-cfi-verify/lib/*.h",
3625 ":AllTargetsAsmParsers",
3626 ":AllTargetsCodeGens",
3627 ":AllTargetsDisassemblers",
3642 "tools/llvm-cov/*.cpp",
3643 "tools/llvm-cov/*.h",
3660 name = "CvtResTableGen",
3661 strip_include_prefix = "tools/llvm-cvtres",
3663 "-gen-opt-parser-defs",
3664 "tools/llvm-cvtres/Opts.inc",
3666 tblgen = ":llvm-tblgen",
3667 td_file = "tools/llvm-cvtres/Opts.td",
3668 td_srcs = ["include/llvm/Option/OptParser.td"],
3672 name = "llvm-cvtres",
3674 "tools/llvm-cvtres/*.cpp",
3688 name = "llvm-cxxdump",
3690 "tools/llvm-cxxdump/*.cpp",
3691 "tools/llvm-cxxdump/*.h",
3696 ":AllTargetsCodeGens",
3705 name = "llvm-cxxmap",
3707 "tools/llvm-cxxmap/*.cpp",
3718 name = "CxxfiltOptsTableGen",
3719 strip_include_prefix = "tools/llvm-cxxfilt",
3721 "-gen-opt-parser-defs",
3722 "tools/llvm-cxxfilt/Opts.inc",
3724 tblgen = ":llvm-tblgen",
3725 td_file = "tools/llvm-cxxfilt/Opts.td",
3726 td_srcs = ["include/llvm/Option/OptParser.td"],
3730 name = "llvm-cxxfilt-lib",
3731 srcs = glob(["tools/llvm-cxxfilt/*.cpp"]),
3734 ":CxxfiltOptsTableGen",
3742 llvm_driver_cc_binary(
3743 name = "llvm-cxxfilt",
3745 deps = [":llvm-cxxfilt-lib"],
3749 name = "llvm-debuginfo-analyzer",
3751 "tools/llvm-debuginfo-analyzer/*.cpp",
3752 "tools/llvm-debuginfo-analyzer/*.h",
3757 ":AllTargetsCodeGens",
3758 ":AllTargetsDisassemblers",
3759 ":DebugInfoLogicalView",
3765 name = "DebugInfodFindOptsTableGen",
3766 strip_include_prefix = "tools/llvm-debuginfod-find",
3768 "-gen-opt-parser-defs",
3769 "tools/llvm-debuginfod-find/Opts.inc",
3771 tblgen = ":llvm-tblgen",
3772 td_file = "tools/llvm-debuginfod-find/Opts.td",
3773 td_srcs = ["include/llvm/Option/OptParser.td"],
3777 name = "llvm-debuginfod-find-lib",
3779 "tools/llvm-debuginfod-find/*.cpp",
3785 ":DebugInfodFindOptsTableGen",
3793 llvm_driver_cc_binary(
3794 name = "llvm-debuginfod-find",
3796 deps = [":llvm-debuginfod-find-lib"],
3802 "tools/llvm-dis/*.cpp",
3815 name = "llvm-dwarfdump",
3817 "tools/llvm-dwarfdump/*.cpp",
3818 "tools/llvm-dwarfdump/*.h",
3823 ":AllTargetsCodeGens",
3835 name = "DwarfutilOptionsTableGen",
3836 strip_include_prefix = "tools/llvm-dwarfutil",
3838 "-gen-opt-parser-defs",
3839 "tools/llvm-dwarfutil/Options.inc",
3841 tblgen = ":llvm-tblgen",
3842 td_file = "tools/llvm-dwarfutil/Options.td",
3843 td_srcs = ["include/llvm/Option/OptParser.td"],
3847 name = "llvm-dwarfutil",
3849 "tools/llvm-dwarfutil/*.cpp",
3850 "tools/llvm-dwarfutil/*.h",
3855 ":AllTargetsAsmParsers",
3856 ":AllTargetsCodeGens",
3859 ":DWARFLinkerParallel",
3861 ":DwarfutilOptionsTableGen",
3873 name = "DwpOptionsTableGen",
3874 strip_include_prefix = "tools/llvm-dwp",
3876 "-gen-opt-parser-defs",
3877 "tools/llvm-dwp/Opts.inc",
3879 tblgen = ":llvm-tblgen",
3880 td_file = "tools/llvm-dwp/Opts.td",
3881 td_srcs = ["include/llvm/Option/OptParser.td"],
3885 name = "llvm-dwp-lib",
3886 srcs = glob(["tools/llvm-dwp/*.cpp"]),
3889 ":AllTargetsCodeGens",
3891 ":DwpOptionsTableGen",
3898 llvm_driver_cc_binary(
3901 deps = [":llvm-dwp-lib"],
3905 name = "llvm-exegesis",
3907 "tools/llvm-exegesis/llvm-exegesis.cpp",
3912 ":AllTargetsAsmParsers",
3913 ":AllTargetsCodeGens",
3914 ":AllTargetsDisassemblers",
3927 name = "llvm-extract",
3929 "tools/llvm-extract/*.cpp",
3947 name = "GSYMUtilOptionsTableGen",
3948 strip_include_prefix = "tools/llvm-gsymutil",
3950 "-gen-opt-parser-defs",
3951 "tools/llvm-gsymutil/Opts.inc",
3953 tblgen = ":llvm-tblgen",
3954 td_file = "tools/llvm-gsymutil/Opts.td",
3955 td_srcs = ["include/llvm/Option/OptParser.td"],
3959 name = "llvm-gsymutil-lib",
3960 srcs = glob(["tools/llvm-gsymutil/*.cpp"]),
3963 ":AllTargetsCodeGens",
3967 ":GSYMUtilOptionsTableGen",
3977 llvm_driver_cc_binary(
3978 name = "llvm-gsymutil",
3980 deps = [":llvm-gsymutil-lib"],
3984 name = "IfsOptionsTableGen",
3985 strip_include_prefix = "tools/llvm-ifs",
3987 "-gen-opt-parser-defs",
3988 "tools/llvm-ifs/Opts.inc",
3990 tblgen = ":llvm-tblgen",
3991 td_file = "tools/llvm-ifs/Opts.td",
3992 td_srcs = ["include/llvm/Option/OptParser.td"],
3996 name = "llvm-ifs-lib",
3998 "tools/llvm-ifs/*.cpp",
3999 "tools/llvm-ifs/*.h",
4004 ":IfsOptionsTableGen",
4014 llvm_driver_cc_binary(
4017 deps = [":llvm-ifs-lib"],
4021 name = "llvm-jitlink",
4023 "tools/llvm-jitlink/*.cpp",
4024 "tools/llvm-jitlink/*.h",
4027 # Make symbols from the standard library dynamically resolvable.
4029 "@platforms//os:windows": [],
4030 "@platforms//os:macos": [],
4031 "//conditions:default": [
4032 "-Wl,--undefined=_ZTIi",
4033 "-Wl,--export-dynamic-symbol=_ZTIi",
4034 "-Wl,--export-dynamic-symbol=__cxa_begin_catch",
4035 "-Wl,--export-dynamic-symbol=__cxa_end_catch",
4036 "-Wl,--export-dynamic-symbol=__gxx_personality_v0",
4037 "-Wl,--export-dynamic-symbol=__cxa_allocate_exception",
4038 "-Wl,--export-dynamic-symbol=__cxa_throw",
4039 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBWrapper",
4044 ":AllTargetsAsmParsers",
4045 ":AllTargetsCodeGens",
4046 ":AllTargetsDisassemblers",
4059 ":OrcTargetProcess",
4067 name = "LibtoolDarwinOptionsTableGen",
4068 strip_include_prefix = "tools/llvm-libtool-darwin",
4070 "-gen-opt-parser-defs",
4071 "tools/llvm-libtool-darwin/Opts.inc",
4073 tblgen = ":llvm-tblgen",
4074 td_file = "tools/llvm-libtool-darwin/Opts.td",
4075 td_srcs = ["include/llvm/Option/OptParser.td"],
4079 name = "llvm-libtool-darwin-lib",
4081 "tools/llvm-libtool-darwin/*.cpp",
4082 "tools/llvm-libtool-darwin/*.h",
4086 ":AllTargetsAsmParsers",
4087 ":AllTargetsCodeGens",
4090 ":LibtoolDarwinOptionsTableGen",
4098 llvm_driver_cc_binary(
4099 name = "llvm-libtool-darwin",
4101 deps = [":llvm-libtool-darwin-lib"],
4107 "tools/llvm-link/*.cpp",
4128 name = "LipoOptsTableGen",
4129 strip_include_prefix = "tools/llvm-lipo",
4131 "-gen-opt-parser-defs",
4132 "tools/llvm-lipo/LipoOpts.inc",
4134 tblgen = ":llvm-tblgen",
4135 td_file = "tools/llvm-lipo/LipoOpts.td",
4136 td_srcs = ["include/llvm/Option/OptParser.td"],
4140 name = "llvm-lipo-lib",
4141 srcs = ["tools/llvm-lipo/llvm-lipo.cpp"],
4144 ":AllTargetsAsmParsers",
4147 ":LipoOptsTableGen",
4156 llvm_driver_cc_binary(
4159 deps = [":llvm-lipo-lib"],
4165 "tools/llvm-lto/*.cpp",
4170 ":AllTargetsAsmParsers",
4171 ":AllTargetsCodeGens",
4187 "tools/llvm-lto2/*.cpp",
4192 ":AllTargetsAsmParsers",
4193 ":AllTargetsCodeGens",
4207 "tools/llvm-mc/*.cpp",
4208 "tools/llvm-mc/*.h",
4213 ":AllTargetsAsmParsers",
4214 ":AllTargetsCodeGens",
4215 ":AllTargetsDisassemblers",
4228 "tools/llvm-mca/llvm-mca.cpp",
4233 ":AllTargetsAsmParsers",
4234 ":AllTargetsCodeGens",
4235 ":AllTargetsDisassemblers",
4247 name = "MlTableGen",
4248 strip_include_prefix = "tools/llvm-ml",
4250 "-gen-opt-parser-defs",
4251 "tools/llvm-ml/Opts.inc",
4253 tblgen = ":llvm-tblgen",
4254 td_file = "tools/llvm-ml/Opts.td",
4255 td_srcs = ["include/llvm/Option/OptParser.td"],
4259 name = "llvm-ml-lib",
4261 "tools/llvm-ml/*.cpp",
4262 "tools/llvm-ml/*.h",
4266 ":AllTargetsAsmParsers",
4267 ":AllTargetsCodeGens",
4268 ":AllTargetsDisassemblers",
4279 llvm_driver_cc_binary(
4282 deps = [":llvm-ml-lib"],
4286 name = "llvm-modextract",
4288 "tools/llvm-modextract/*.cpp",
4302 name = "MtTableGen",
4303 strip_include_prefix = "tools/llvm-mt",
4305 "-gen-opt-parser-defs",
4306 "tools/llvm-mt/Opts.inc",
4308 tblgen = ":llvm-tblgen",
4309 td_file = "tools/llvm-mt/Opts.td",
4310 td_srcs = ["include/llvm/Option/OptParser.td"],
4314 name = "llvm-mt-lib",
4315 srcs = glob(["tools/llvm-mt/*.cpp"]),
4326 llvm_driver_cc_binary(
4329 deps = [":llvm-mt-lib"],
4333 name = "NmOptsTableGen",
4334 strip_include_prefix = "tools/llvm-nm",
4336 "-gen-opt-parser-defs",
4337 "tools/llvm-nm/Opts.inc",
4339 tblgen = ":llvm-tblgen",
4340 td_file = "tools/llvm-nm/Opts.td",
4341 td_srcs = ["include/llvm/Option/OptParser.td"],
4345 name = "llvm-nm-lib",
4346 srcs = glob(["tools/llvm-nm/*.cpp"]),
4349 ":AllTargetsAsmParsers",
4350 ":AllTargetsCodeGens",
4364 llvm_driver_cc_binary(
4367 deps = [":llvm-nm-lib"],
4371 name = "llvm-objcopy-opts",
4372 strip_include_prefix = "tools/llvm-objcopy",
4374 "-gen-opt-parser-defs",
4375 "tools/llvm-objcopy/ObjcopyOpts.inc",
4377 tblgen = ":llvm-tblgen",
4378 td_file = "tools/llvm-objcopy/ObjcopyOpts.td",
4380 "include/llvm/Option/OptParser.td",
4381 "tools/llvm-objcopy/CommonOpts.td",
4386 name = "llvm-installnametool-opts",
4387 strip_include_prefix = "tools/llvm-objcopy",
4389 "-gen-opt-parser-defs",
4390 "tools/llvm-objcopy/InstallNameToolOpts.inc",
4392 tblgen = ":llvm-tblgen",
4393 td_file = "tools/llvm-objcopy/InstallNameToolOpts.td",
4395 "include/llvm/Option/OptParser.td",
4396 "tools/llvm-objcopy/CommonOpts.td",
4401 name = "llvm-strip-opts",
4402 strip_include_prefix = "tools/llvm-objcopy",
4404 "-gen-opt-parser-defs",
4405 "tools/llvm-objcopy/StripOpts.inc",
4407 tblgen = ":llvm-tblgen",
4408 td_file = "tools/llvm-objcopy/StripOpts.td",
4410 "include/llvm/Option/OptParser.td",
4411 "tools/llvm-objcopy/CommonOpts.td",
4416 name = "llvm-bitcode-strip-opts",
4417 strip_include_prefix = "tools/llvm-objcopy",
4419 "-gen-opt-parser-defs",
4420 "tools/llvm-objcopy/BitcodeStripOpts.inc",
4422 tblgen = ":llvm-tblgen",
4423 td_file = "tools/llvm-objcopy/BitcodeStripOpts.td",
4425 "include/llvm/Option/OptParser.td",
4426 "tools/llvm-objcopy/CommonOpts.td",
4431 name = "llvm-stress",
4433 "tools/llvm-stress/*.cpp",
4444 name = "llvm-objcopy-lib",
4446 "tools/llvm-objcopy/*.cpp",
4447 "tools/llvm-objcopy/*.h",
4460 ":llvm-bitcode-strip-opts",
4461 ":llvm-installnametool-opts",
4462 ":llvm-objcopy-opts",
4467 llvm_driver_cc_binary(
4468 name = "llvm-objcopy",
4470 deps = [":llvm-objcopy-lib"],
4474 name = "llvm-strip",
4475 binary = ":llvm-objcopy",
4479 name = "llvm-bitcode-strip",
4480 binary = ":llvm-objcopy",
4484 name = "llvm-install-name-tool",
4485 binary = ":llvm-objcopy",
4489 name = "llvm-objdump-lib",
4491 "tools/llvm-objdump/*.cpp",
4492 "tools/llvm-objdump/*.h",
4496 ":AllTargetsAsmParsers",
4497 ":AllTargetsCodeGens",
4498 ":AllTargetsDisassemblers",
4507 ":ObjdumpOptsTableGen",
4510 ":OtoolOptsTableGen",
4518 llvm_driver_cc_binary(
4519 name = "llvm-objdump",
4521 deps = [":llvm-objdump-lib"],
4525 name = "ObjdumpOptsTableGen",
4526 strip_include_prefix = "tools/llvm-objdump",
4528 "-gen-opt-parser-defs",
4529 "tools/llvm-objdump/ObjdumpOpts.inc",
4531 tblgen = ":llvm-tblgen",
4532 td_file = "tools/llvm-objdump/ObjdumpOpts.td",
4533 td_srcs = ["include/llvm/Option/OptParser.td"],
4537 name = "llvm-otool",
4538 binary = ":llvm-objdump",
4542 name = "OtoolOptsTableGen",
4543 strip_include_prefix = "tools/llvm-objdump",
4545 "-gen-opt-parser-defs",
4546 "tools/llvm-objdump/OtoolOpts.inc",
4548 tblgen = ":llvm-tblgen",
4549 td_file = "tools/llvm-objdump/OtoolOpts.td",
4550 td_srcs = ["include/llvm/Option/OptParser.td"],
4554 name = "llvm-opt-report",
4556 "tools/llvm-opt-report/*.cpp",
4561 ":AllTargetsCodeGens",
4569 name = "llvm-pdbutil",
4571 "tools/llvm-pdbutil/*.cpp",
4572 "tools/llvm-pdbutil/*.h",
4579 ":DebugInfoCodeView",
4590 name = "llvm-profdata-lib",
4591 srcs = glob(["tools/llvm-profdata/*.cpp"]),
4602 llvm_driver_cc_binary(
4603 name = "llvm-profdata",
4605 deps = [":llvm-profdata-lib"],
4609 name = "llvm-profgen",
4611 "tools/llvm-profgen/*.cpp",
4612 "tools/llvm-profgen/*.h",
4617 ":AllTargetsCodeGens",
4618 ":AllTargetsDisassemblers",
4634 name = "RcTableGen",
4635 strip_include_prefix = "tools/llvm-rc",
4637 "-gen-opt-parser-defs",
4638 "tools/llvm-rc/Opts.inc",
4640 tblgen = ":llvm-tblgen",
4641 td_file = "tools/llvm-rc/Opts.td",
4642 td_srcs = ["include/llvm/Option/OptParser.td"],
4646 name = "WindresTableGen",
4647 strip_include_prefix = "tools/llvm-rc",
4649 "-gen-opt-parser-defs",
4650 "tools/llvm-rc/WindresOpts.inc",
4652 tblgen = ":llvm-tblgen",
4653 td_file = "tools/llvm-rc/WindresOpts.td",
4654 td_srcs = ["include/llvm/Option/OptParser.td"],
4657 # Workaround inability to put `.def` files into `srcs` with a library.
4659 name = "llvm-rc-defs-lib",
4660 textual_hdrs = glob(["tools/llvm-rc/*.def"]),
4664 name = "llvm-rc-lib",
4666 "tools/llvm-rc/*.cpp",
4667 "tools/llvm-rc/*.h",
4678 ":llvm-rc-defs-lib",
4682 llvm_driver_cc_binary(
4685 deps = [":llvm-rc-lib"],
4689 name = "llvm-windres",
4690 binary = ":llvm-rc",
4694 name = "ReadobjOptsTableGen",
4695 strip_include_prefix = "tools/llvm-readobj",
4697 "-gen-opt-parser-defs",
4698 "tools/llvm-readobj/Opts.inc",
4700 tblgen = ":llvm-tblgen",
4701 td_file = "tools/llvm-readobj/Opts.td",
4702 td_srcs = ["include/llvm/Option/OptParser.td"],
4706 name = "llvm-readobj-lib",
4708 "tools/llvm-readobj/*.cpp",
4709 "tools/llvm-readobj/*.h",
4713 ":AllTargetsCodeGens",
4716 ":DebugInfoCodeView",
4722 ":ReadobjOptsTableGen",
4727 llvm_driver_cc_binary(
4728 name = "llvm-readobj",
4730 deps = [":llvm-readobj-lib"],
4733 # Create an 'llvm-readelf' named binary from the 'llvm-readobj' tool.
4735 name = "llvm-readelf",
4736 binary = ":llvm-readobj",
4740 name = "llvm-reduce",
4742 "tools/llvm-reduce/**/*.cpp",
4743 "tools/llvm-reduce/**/*.h",
4746 includes = ["tools/llvm-reduce"],
4749 ":AllTargetsAsmParsers",
4750 ":AllTargetsCodeGens",
4770 name = "llvm-rtdyld",
4772 "tools/llvm-rtdyld/*.cpp",
4777 ":AllTargetsCodeGens",
4778 ":AllTargetsDisassemblers",
4790 name = "SizeOptsTableGen",
4791 strip_include_prefix = "tools/llvm-size",
4793 "-gen-opt-parser-defs",
4794 "tools/llvm-size/Opts.inc",
4796 tblgen = ":llvm-tblgen",
4797 td_file = "tools/llvm-size/Opts.td",
4798 td_srcs = ["include/llvm/Option/OptParser.td"],
4802 name = "llvm-size-lib",
4803 srcs = glob(["tools/llvm-size/*.cpp"]),
4808 ":SizeOptsTableGen",
4813 llvm_driver_cc_binary(
4816 deps = [":llvm-size-lib"],
4820 name = "llvm-split",
4822 "tools/llvm-split/*.cpp",
4827 ":AllTargetsAsmParsers",
4828 ":AllTargetsCodeGens",
4842 name = "StringsOptsTableGen",
4843 strip_include_prefix = "tools/llvm-strings",
4845 "-gen-opt-parser-defs",
4846 "tools/llvm-strings/Opts.inc",
4848 tblgen = ":llvm-tblgen",
4849 td_file = "tools/llvm-strings/Opts.td",
4850 td_srcs = ["include/llvm/Option/OptParser.td"],
4854 name = "llvm-strings",
4856 "tools/llvm-strings/*.cpp",
4863 ":StringsOptsTableGen",
4869 name = "SymbolizerOptsTableGen",
4870 strip_include_prefix = "tools/llvm-symbolizer",
4872 "-gen-opt-parser-defs",
4873 "tools/llvm-symbolizer/Opts.inc",
4875 tblgen = ":llvm-tblgen",
4876 td_file = "tools/llvm-symbolizer/Opts.td",
4877 td_srcs = ["include/llvm/Option/OptParser.td"],
4881 name = "llvm-symbolizer-lib",
4882 srcs = glob(["tools/llvm-symbolizer/*.cpp"]),
4892 ":SymbolizerOptsTableGen",
4897 llvm_driver_cc_binary(
4898 name = "llvm-symbolizer",
4900 deps = [":llvm-symbolizer-lib"],
4904 name = "llvm-addr2line",
4905 binary = ":llvm-symbolizer",
4909 name = "llvm-undname",
4911 "tools/llvm-undname/*.cpp",
4924 "tools/llvm-xray/*.cpp",
4925 "tools/llvm-xray/*.h",
4939 name = "opt-driver",
4946 "@platforms//os:windows": [],
4947 "@platforms//os:macos": [],
4948 "//conditions:default": ["-Wl,--export-dynamic"],
4951 ":AllTargetsAsmParsers",
4952 ":AllTargetsCodeGens",
4971 ":common_transforms",
4979 deps = [":opt-driver"],
4983 name = "SancovOptsTableGen",
4984 strip_include_prefix = "tools/sancov",
4986 "-gen-opt-parser-defs",
4987 "tools/sancov/Opts.inc",
4989 tblgen = ":llvm-tblgen",
4990 td_file = "tools/sancov/Opts.td",
4991 td_srcs = ["include/llvm/Option/OptParser.td"],
4995 name = "sancov-lib",
4996 srcs = glob(["tools/sancov/*.cpp"]),
4999 ":AllTargetsCodeGens",
5000 ":AllTargetsDisassemblers",
5007 ":SancovOptsTableGen",
5013 llvm_driver_cc_binary(
5016 deps = [":sancov-lib"],
5022 "tools/sanstats/*.cpp",
5034 name = "split-file",
5036 "utils/split-file/*.cpp",
5045 ################################################################################
5046 # Begin testonly libraries
5049 name = "FuzzMutate",
5051 srcs = glob(["lib/FuzzMutate/*.cpp"]),
5052 hdrs = glob(["include/llvm/FuzzMutate/*.h"]),
5054 includes = ["include"],
5070 srcs = glob(["tools/llvm-diff/lib/*.cpp"]),
5071 hdrs = glob(["tools/llvm-diff/lib/*.h"]),
5081 srcs = ["utils/lit/lit.py"] + glob(["utils/lit/lit/**/*.py"]),
5082 imports = ["utils/lit"],
5086 name = "extract_ir",
5088 "utils/mlgo-utils/mlgo/__init__.py",
5089 "utils/mlgo-utils/mlgo/corpus/extract_ir.py",
5090 "utils/mlgo-utils/mlgo/corpus/extract_ir_lib.py",
5092 imports = ["utils/mlgo-utils"],
5096 name = "combine_training_corpus",
5098 "utils/mlgo-utils/mlgo/__init__.py",
5099 "utils/mlgo-utils/mlgo/corpus/combine_training_corpus.py",
5100 "utils/mlgo-utils/mlgo/corpus/combine_training_corpus_lib.py",
5102 imports = ["utils/mlgo-utils"],
5106 name = "make_corpus",
5108 "utils/mlgo-utils/mlgo/__init__.py",
5109 "utils/mlgo-utils/mlgo/corpus/make_corpus.py",
5110 "utils/mlgo-utils/mlgo/corpus/make_corpus_lib.py",
5112 imports = ["utils/mlgo-utils"],
5116 name = "TestingADT",
5119 "include/llvm/Testing/ADT/*.h",
5124 "//third-party/unittest:gmock",
5129 name = "TestingSupport",
5132 "lib/Testing/Support/*.cpp",
5134 hdrs = glob(["include/llvm/Testing/Support/*.h"]),
5139 "//third-party/unittest:gmock",
5140 "//third-party/unittest:gtest",
5145 name = "TestingAnnotations",
5147 srcs = ["lib/Testing/Annotations/Annotations.cpp"],
5148 hdrs = ["include/llvm/Testing/Annotations/Annotations.h"],
5150 deps = [":Support"],
5153 ################################################################################
5154 # Begin testonly binary utilities
5160 "utils/FileCheck/*.cpp",
5173 "tools/bugpoint/*.cpp",
5174 "tools/bugpoint/*.h",
5179 ":AllTargetsAsmParsers",
5180 ":AllTargetsCodeGens",
5196 ":common_transforms",
5208 deps = [":Support"],
5212 name = "lli-child-target",
5215 "tools/lli/ChildTarget/*.cpp",
5218 # The tests load code into this binary that expect to see symbols
5219 # from libstdc++ such as __cxa_begin_catch and _ZTIi. The latter
5220 # isn't even used in the main binary, so we also need to force it
5223 "@platforms//os:windows": [],
5224 "@platforms//os:macos": [],
5225 "//conditions:default": [
5233 ":OrcTargetProcess",
5237 ":intrinsic_enums_gen",
5242 name = "llvm-c-test",
5245 "tools/llvm-c-test/*.c",
5246 "tools/llvm-c-test/*.cpp",
5247 "tools/llvm-c-test/*.h",
5251 ":AllTargetsAsmParsers",
5252 ":AllTargetsCodeGens",
5253 ":AllTargetsDisassemblers",
5281 "tools/llvm-diff/*.cpp",
5295 name = "llvm-isel-fuzzer",
5298 "tools/llvm-isel-fuzzer/*.cpp",
5303 ":AllTargetsAsmParsers",
5304 ":AllTargetsCodeGens",
5319 # This is really a Python script, but call it sh_binary to ignore the hyphen in
5320 # the path, which py_binary does not allow.
5321 # Also, note: llvm-locstats expects llvm-dwarfdump to be in the same directory
5324 name = "llvm-locstats",
5327 "utils/llvm-locstats/*.py",
5329 # llvm-locstats is a thin wrapper around llvm-dwarfdump.
5330 data = [":llvm-dwarfdump"],
5334 name = "llvm-original-di-preservation",
5336 srcs = ["utils/llvm-original-di-preservation.py"],
5347 deps = [":Support"],
5351 name = "llvm-opt-fuzzer",
5354 "tools/llvm-opt-fuzzer/*.cpp",
5359 ":AllTargetsCodeGens",
5375 name = "ReadTAPIOptsTableGen",
5376 strip_include_prefix = "tools/llvm-readtapi",
5378 "-gen-opt-parser-defs",
5379 "tools/llvm-readtapi/TapiOpts.inc",
5381 tblgen = ":llvm-tblgen",
5382 td_file = "tools/llvm-readtapi/TapiOpts.td",
5383 td_srcs = ["include/llvm/Option/OptParser.td"],
5387 name = "llvm-readtapi",
5390 "tools/llvm-readtapi/*.cpp",
5391 "tools/llvm-readtapi/*.h",
5399 ":ReadTAPIOptsTableGen",
5402 ":TextAPIBinaryReader",
5407 name = "TLICheckerOptsTableGen",
5408 strip_include_prefix = "tools/llvm-tli-checker",
5410 "-gen-opt-parser-defs",
5411 "tools/llvm-tli-checker/Opts.inc",
5413 tblgen = ":llvm-tblgen",
5414 td_file = "tools/llvm-tli-checker/Opts.td",
5415 td_srcs = ["include/llvm/Option/OptParser.td"],
5419 name = "llvm-tli-checker",
5422 "tools/llvm-tli-checker/*.cpp",
5439 ":TLICheckerOptsTableGen",
5450 "tools/obj2yaml/*.cpp",
5451 "tools/obj2yaml/*.h",
5457 ":DebugInfoCodeView",
5466 name = "verify-uselistorder",
5468 "tools/verify-uselistorder/*.cpp",
5487 "tools/yaml2obj/*.cpp",
5493 ":DebugInfoCodeView",
5502 name = "yaml-bench",
5505 "utils/yaml-bench/*.cpp",