Debian Codegraph @

utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

raw
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
4
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", "gentbl_cc_library", "gentbl_filegroup", "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
15 package(
16 default_visibility = ["//visibility:public"],
17 features = ["layering_check"],
18 )
19
20 licenses(["notice"])
21
22 exports_files([
23 "LICENSE.TXT",
24 "cmake/modules/llvm-driver-template.cpp.in",
25 "include/llvm/BinaryFormat/Dwarf.def",
26 "include/llvm/CodeGen/SDNodeProperties.td",
27 "include/llvm/CodeGen/ValueTypes.td",
28 "include/llvm/Frontend/Directive/DirectiveBase.td",
29 "include/llvm/Frontend/OpenACC/ACC.td",
30 "include/llvm/Frontend/OpenMP/OMP.td",
31 "include/llvm/IR/Intrinsics.td",
32 "include/llvm/Option/OptParser.td",
33 "utils/lit/lit.py",
34 # This one is needed for building and vendoring out lldb from off tree.
35 "utils/lldbDataFormatters.py",
36 ])
37
38 # It may be tempting to add compiler flags here, but that should be avoided.
39 # The necessary warnings and other compile flags should be provided by the
40 # toolchain or the `.bazelrc` file. This is just a workaround until we have a
41 # widely available feature to enable unlimited stack frame instead of using
42 # this `Make` variable.
43 llvm_copts = [
44 "$(STACK_FRAME_UNLIMITED)",
45 ]
46
47 enum_targets_gen(
48 name = "targets_def_gen",
49 src = "include/llvm/Config/Targets.def.in",
50 out = "include/llvm/Config/Targets.def",
51 macro_name = "TARGET",
52 targets = llvm_targets,
53 )
54
55 # Enabled targets with ASM printers.
56 llvm_target_asm_printers = [
57 t
58 for t in llvm_targets
59 if glob(["lib/Target/{}/*AsmPrinter.cpp".format(t)])
60 ]
61
62 enum_targets_gen(
63 name = "asm_printers_def_gen",
64 src = "include/llvm/Config/AsmPrinters.def.in",
65 out = "include/llvm/Config/AsmPrinters.def",
66 macro_name = "ASM_PRINTER",
67 targets = llvm_target_asm_printers,
68 )
69
70 # Enabled targets with ASM parsers.
71 llvm_target_asm_parsers = [
72 t
73 for t in llvm_targets
74 if glob(
75 ["lib/Target/{}/AsmParser/CMakeLists.txt".format(t)],
76 allow_empty = True,
77 )
78 ]
79
80 enum_targets_gen(
81 name = "asm_parsers_def_gen",
82 src = "include/llvm/Config/AsmParsers.def.in",
83 out = "include/llvm/Config/AsmParsers.def",
84 macro_name = "ASM_PARSER",
85 targets = llvm_target_asm_parsers,
86 )
87
88 # Enabled targets with disassemblers.
89 llvm_target_disassemblers = [
90 t
91 for t in llvm_targets
92 if glob(
93 ["lib/Target/{}/Disassembler/CMakeLists.txt".format(t)],
94 allow_empty = True,
95 )
96 ]
97
98 enum_targets_gen(
99 name = "disassemblers_def_gen",
100 src = "include/llvm/Config/Disassemblers.def.in",
101 out = "include/llvm/Config/Disassemblers.def",
102 macro_name = "DISASSEMBLER",
103 targets = llvm_target_disassemblers,
104 )
105
106 # Enabled targets with MCA.
107 llvm_target_mcas = [
108 t
109 for t in llvm_targets
110 if glob(
111 ["lib/Target/{}/MCA/CMakeLists.txt".format(t)],
112 allow_empty = True,
113 )
114 ]
115
116 enum_targets_gen(
117 name = "target_mca_def_gen",
118 src = "include/llvm/Config/TargetMCAs.def.in",
119 out = "include/llvm/Config/TargetMCAs.def",
120 macro_name = "TARGETMCA",
121 targets = llvm_target_mcas,
122 )
123
124 # Enabled targets with exegesis.
125 llvm_target_exegesis = [
126 t
127 for t in llvm_targets
128 if glob(
129 ["tools/llvm-exegesis/lib/{}/CMakeLists.txt".format(t)],
130 allow_empty = True,
131 )
132 ]
133
134 enum_targets_gen(
135 name = "target_exegesis_def_gen",
136 src = "include/llvm/Config/TargetExegesis.def.in",
137 out = "include/llvm/Config/TargetExegesis.def",
138 macro_name = "EXEGESIS",
139 placeholder_name = "@LLVM_ENUM_EXEGESIS@",
140 targets = llvm_target_exegesis,
141 )
142
143 expand_template(
144 name = "abi_breaking_h_gen",
145 out = "include/llvm/Config/abi-breaking.h",
146 substitutions = {
147 # Define to enable checks that alter the LLVM C++ ABI
148 "#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS": "#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0",
149
150 # Define to enable reverse iteration of unordered llvm containers
151 "#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION": "#define LLVM_ENABLE_REVERSE_ITERATION 0",
152 },
153 template = "include/llvm/Config/abi-breaking.h.cmake",
154 )
155
156 # To enable diff testing out of tree
157 exports_files([
158 "include/llvm/Config/config.h.cmake",
159 "include/llvm/Config/llvm-config.h.cmake",
160 "include/llvm/Config/abi-breaking.h.cmake",
161 ])
162
163 td_library(
164 name = "OptParserTdFiles",
165 srcs = ["include/llvm/Option/OptParser.td"],
166 includes = ["include"],
167 )
168
169 llvm_config_target_defines = [
170 "LLVM_HAS_{}_TARGET=1".format(t)
171 for t in llvm_targets
172 ]
173
174 cc_library(
175 name = "config",
176 hdrs = [
177 "include/llvm/Config/Targets.h",
178 "include/llvm/Config/abi-breaking.h",
179 "include/llvm/Config/llvm-config.h",
180 ],
181 copts = llvm_copts,
182 defines = llvm_config_defines + llvm_config_target_defines,
183 includes = ["include"],
184 textual_hdrs = [
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",
193 ],
194 )
195
196 cc_library(
197 name = "Demangle",
198 srcs = glob([
199 "lib/Demangle/*.cpp",
200 ]),
201 hdrs = glob([
202 "include/llvm/Demangle/*.h",
203 "include/llvm/Demangle/*.def",
204 ]),
205 copts = llvm_copts,
206 deps = [":config"],
207 )
208
209 genrule(
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",
214 )
215
216 genrule(
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",
221 )
222
223 cc_library(
224 name = "Support",
225 srcs = glob([
226 "lib/Support/*.c",
227 "lib/Support/*.cpp",
228 "lib/Support/*.h",
229 "lib/Support/*.inc",
230 # To avoid a dependency cycle.
231 "include/llvm/Option/*.h",
232 ]) + select({
233 "@platforms//os:windows": glob([
234 "lib/Support/Windows/*.inc",
235 ]),
236 "//conditions:default": glob([
237 "lib/Support/Unix/*.h",
238 "lib/Support/Unix/*.inc",
239 ]),
240 }) + [
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",
246 ] + select({
247 "@platforms//cpu:aarch64": [
248 "lib/Support/BLAKE3/blake3_neon.c",
249 ],
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",
255 ],
256 "//conditions:default": [
257 ],
258 }),
259 hdrs = glob([
260 "include/llvm/Support/**/*.h",
261 "include/llvm/ADT/*.h",
262 ]) + [
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/Visibility.h",
273 "include/llvm-c/blake3.h",
274 "include/llvm/ExecutionEngine/JITSymbol.h",
275 "include/llvm/Support/Extension.def",
276 "include/llvm/Support/VCSRevision.h",
277 ],
278 copts = llvm_copts,
279 defines = select({
280 "@platforms//cpu:aarch64": [
281 ],
282 "//conditions:default": [
283 "BLAKE3_USE_NEON=0",
284 ],
285 }) + select({
286 "@platforms//cpu:x86_64": [
287 ],
288 "//conditions:default": [
289 "BLAKE3_NO_AVX2",
290 "BLAKE3_NO_AVX512",
291 "BLAKE3_NO_SSE2",
292 "BLAKE3_NO_SSE41",
293 ],
294 }),
295 includes = ["include"],
296 linkopts = select({
297 "@platforms//os:windows": [
298 "ws2_32.lib",
299 "ntdll.lib",
300 ],
301 "@platforms//os:freebsd": [
302 "-pthread",
303 "-lexecinfo",
304 "-ldl",
305 "-lm",
306 ],
307 "@platforms//os:macos": [
308 "-pthread",
309 "-ldl",
310 ],
311 "//conditions:default": [
312 "-pthread",
313 "-ldl",
314 "-lm",
315 ],
316 }),
317 textual_hdrs = glob([
318 "include/llvm/Support/*.def",
319 ]),
320 deps = [
321 ":config",
322 ":Demangle",
323 "//third-party/siphash",
324 # We unconditionally depend on the custom LLVM zlib wrapper. This will
325 # be an empty library unless zlib is enabled, in which case it will
326 # both provide the necessary dependencies and configuration defines.
327 "@llvm_zlib//:zlib",
328 # We unconditionally depend on the custom LLVM zstd wrapper. This will
329 # be an empty library unless zstd is enabled, in which case it will
330 # both provide the necessary dependencies and configuration defines.
331 "@llvm_zstd//:zstd",
332 ],
333 )
334
335 # Note: although FileCheck (the binary) is a test utility, some non-test
336 # targets depend on the FileCheck library target.
337 cc_library(
338 name = "FileCheckLib",
339 srcs = glob([
340 "lib/FileCheck/*.cpp",
341 "lib/FileCheck/*.h",
342 ]),
343 hdrs = glob(["include/llvm/FileCheck/*.h"]),
344 copts = llvm_copts,
345 deps = [":Support"],
346 )
347
348 cc_library(
349 name = "LineEditor",
350 srcs = glob([
351 "lib/LineEditor/*.cpp",
352 ]),
353 hdrs = glob(["include/llvm/LineEditor/*.h"]),
354 copts = llvm_copts,
355 deps = [
356 ":Support",
357 ":config",
358 ],
359 )
360
361 cc_library(
362 name = "Option",
363 srcs = glob([
364 "lib/Option/*.cpp",
365 ]),
366 hdrs = glob(["include/llvm/Option/*.h"]),
367 copts = llvm_copts,
368 deps = [
369 ":Support",
370 ":config",
371 ],
372 )
373
374 cc_library(
375 name = "TableGen",
376 srcs = glob([
377 "lib/TableGen/*.cpp",
378 "lib/TableGen/*.h",
379 ]),
380 hdrs = glob(["include/llvm/TableGen/*.h"]),
381 copts = llvm_copts,
382 deps = [
383 ":FrontendDirective",
384 ":Support",
385 ":config",
386 ],
387 )
388
389 # This exists to avoid circular dependencies.
390 cc_library(
391 name = "ir_headers",
392 hdrs = glob(
393 [
394 "include/llvm/*.h",
395 "include/llvm/IR/*.h",
396 ],
397 exclude = [
398 "include/llvm/LinkAllPasses.h",
399 ],
400 ) + [
401 "include/llvm-c/Comdat.h",
402 "include/llvm-c/DebugInfo.h",
403 "include/llvm/IR/Value.def",
404 ],
405 copts = llvm_copts,
406 )
407
408 cc_library(
409 name = "BinaryFormat",
410 srcs = glob([
411 "lib/BinaryFormat/*.cpp",
412 ]),
413 hdrs = glob([
414 "include/llvm/BinaryFormat/*.h",
415 ]),
416 copts = llvm_copts,
417 includes = ["include"],
418 textual_hdrs = glob([
419 "include/llvm/BinaryFormat/*.def",
420 "include/llvm/BinaryFormat/ELFRelocs/*.def",
421 ]),
422 deps = [
423 ":PPCTargetParser",
424 ":Support",
425 ":TargetParser",
426 ],
427 )
428
429 cc_library(
430 name = "DebugInfo",
431 hdrs = glob(["include/llvm/DebugInfo/*.h"]),
432 copts = llvm_copts,
433 deps = [
434 ":Object",
435 ":Support",
436 ],
437 )
438
439 cc_library(
440 name = "DebugInfoMSF",
441 srcs = glob([
442 "lib/DebugInfo/MSF/*.cpp",
443 ]),
444 hdrs = glob(["include/llvm/DebugInfo/MSF/*.h"]),
445 copts = llvm_copts,
446 deps = [":Support"],
447 )
448
449 cc_library(
450 name = "DebugInfoBTF",
451 srcs = glob([
452 "lib/DebugInfo/BTF/*.cpp",
453 ]),
454 hdrs = glob(["include/llvm/DebugInfo/BTF/*.h"]) + [
455 "include/llvm/DebugInfo/BTF/BTF.def",
456 ],
457 copts = llvm_copts,
458 deps = [
459 ":DebugInfo",
460 ":Object",
461 ":Support",
462 ],
463 )
464
465 cc_library(
466 name = "DebugInfoCodeView",
467 srcs = glob([
468 "lib/DebugInfo/CodeView/*.cpp",
469 ]),
470 hdrs = glob([
471 "include/llvm/DebugInfo/CodeView/*.h",
472 ]),
473 copts = llvm_copts,
474 textual_hdrs = glob([
475 "include/llvm/DebugInfo/CodeView/*.def",
476 ]),
477 deps = [
478 ":BinaryFormat",
479 ":DebugInfoMSF",
480 ":Support",
481 ],
482 )
483
484 cc_library(
485 name = "DebugInfoLogicalView",
486 srcs = glob([
487 "lib/DebugInfo/LogicalView/**/*.cpp",
488 ]),
489 hdrs = glob([
490 "include/llvm/DebugInfo/LogicalView/**/*.h",
491 ]),
492 copts = llvm_copts,
493 deps = [
494 ":BinaryFormat",
495 ":DebugInfo",
496 ":DebugInfoCodeView",
497 ":DebugInfoDWARF",
498 ":DebugInfoDWARFLowLevel",
499 ":DebugInfoPDB",
500 ":Demangle",
501 ":MC",
502 ":MCDisassembler",
503 ":Object",
504 ":Support",
505 ],
506 )
507
508 cc_library(
509 name = "DebugInfoPDB",
510 srcs = glob([
511 "lib/DebugInfo/PDB/*.cpp",
512 "lib/DebugInfo/PDB/Native/*.cpp",
513 ]),
514 hdrs = glob([
515 "include/llvm/DebugInfo/PDB/*.h",
516 "include/llvm/DebugInfo/PDB/Native/*.h",
517 ]),
518 copts = llvm_copts,
519 deps = [
520 ":BinaryFormat",
521 ":DebugInfo",
522 ":DebugInfoBTF",
523 ":DebugInfoCodeView",
524 ":DebugInfoMSF",
525 ":Object",
526 ":Support",
527 ":config",
528 ],
529 )
530
531 cc_library(
532 name = "Debuginfod",
533 srcs = glob([
534 "lib/Debuginfod/*.cpp",
535 ]),
536 hdrs = glob([
537 "include/llvm/Debuginfod/*.h",
538 ]),
539 copts = llvm_copts,
540 deps = [
541 ":BinaryFormat",
542 ":DebugInfoDWARF",
543 ":Object",
544 ":Support",
545 ":Symbolize",
546 ],
547 )
548
549 cc_library(
550 name = "DWARFCFIChecker",
551 srcs = glob(["lib/DWARFCFIChecker/*.cpp",
552 "lib/DWARFCFIChecker/*.h",]),
553 hdrs = glob(["include/llvm/DWARFCFIChecker/*.h"]),
554 copts = llvm_copts,
555 deps = [
556 ":BinaryFormat",
557 ":DebugInfoDWARFLowLevel",
558 ":MC",
559 ":Support",
560 ],
561 )
562
563 cc_library(
564 name = "MC",
565 srcs = glob([
566 "lib/MC/*.cpp",
567 ]),
568 hdrs = glob([
569 "include/llvm/MC/*.h",
570 ]),
571 copts = llvm_copts,
572 deps = [
573 ":BinaryFormat",
574 ":DebugInfoCodeView",
575 ":Support",
576 ":TargetParser",
577 ":config",
578 ":ir_headers",
579 ],
580 )
581
582 cc_library(
583 name = "DebugInfoDWARF",
584 srcs = glob([
585 "lib/DebugInfo/DWARF/*.cpp",
586 ]),
587 hdrs = glob(["include/llvm/DebugInfo/DWARF/*.h"]),
588 copts = llvm_copts,
589 deps = [
590 ":BinaryFormat",
591 ":DebugInfo",
592 ":DebugInfoDWARFLowLevel",
593 ":MC",
594 ":Object",
595 ":Support",
596 ":TargetParser",
597 ],
598 )
599
600 cc_library(
601 name = "DebugInfoDWARFLowLevel",
602 srcs = glob([
603 "lib/DebugInfo/DWARF/LowLevel/*.cpp",
604 ]),
605 hdrs = glob(["include/llvm/DebugInfo/DWARF/LowLevel/*.h"]),
606 copts = llvm_copts,
607 deps = [
608 ":BinaryFormat",
609 ":Support",
610 ":TargetParser",
611 ],
612 )
613
614 cc_library(
615 name = "DebugInfoGSYM",
616 srcs = glob([
617 "lib/DebugInfo/GSYM/*.cpp",
618 ]),
619 hdrs = glob(["include/llvm/DebugInfo/GSYM/*.h"]),
620 copts = llvm_copts,
621 deps = [
622 ":DebugInfo",
623 ":DebugInfoDWARF",
624 ":MC",
625 ":Object",
626 ":Support",
627 ],
628 )
629
630 cc_library(
631 name = "Symbolize",
632 srcs = glob([
633 "lib/DebugInfo/Symbolize/*.cpp",
634 ]),
635 hdrs = glob([
636 "include/llvm/DebugInfo/Symbolize/*.h",
637 "include/llvm/Debuginfod/*.h",
638 ]),
639 copts = llvm_copts,
640 deps = [
641 ":BinaryFormat",
642 ":DebugInfo",
643 ":DebugInfoBTF",
644 ":DebugInfoDWARF",
645 ":DebugInfoGSYM",
646 ":DebugInfoPDB",
647 ":Demangle",
648 ":Object",
649 ":Support",
650 ":TargetParser",
651 ],
652 )
653
654 # Command line flag to control which tools get included in the llvm driver binary.
655 # The macro also generates config_setting targets used by select_driver_tools().
656 generate_driver_selects(name = "driver-tools")
657
658 generate_driver_tools_def(
659 name = "gen_llvm_driver_tools_def",
660 out = "LLVMDriverTools.def",
661 driver_tools = select_driver_tools(":driver-tools"),
662 )
663
664 # Workaround inability to put `.def` files into `srcs` with a library
665 cc_library(
666 name = "llvm_driver_tools_def_lib",
667 includes = ["."],
668 textual_hdrs = ["LLVMDriverTools.def"],
669 )
670
671 cc_binary(
672 name = "llvm",
673 srcs = glob(["tools/llvm-driver/*.cpp"]),
674 deps = [
675 ":Support",
676 ":llvm_driver_tools_def_lib",
677 ] + select_driver_tools(":driver-tools"),
678 )
679
680 cc_binary(
681 name = "llvm-min-tblgen",
682 srcs = [
683 "utils/TableGen/Basic/ARMTargetDefEmitter.cpp",
684 "utils/TableGen/Basic/Attributes.cpp",
685 "utils/TableGen/Basic/CodeGenIntrinsics.cpp",
686 "utils/TableGen/Basic/CodeGenIntrinsics.h",
687 "utils/TableGen/Basic/DirectiveEmitter.cpp",
688 "utils/TableGen/Basic/IntrinsicEmitter.cpp",
689 "utils/TableGen/Basic/RISCVTargetDefEmitter.cpp",
690 "utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp",
691 "utils/TableGen/Basic/SDNodeProperties.cpp",
692 "utils/TableGen/Basic/SDNodeProperties.h",
693 "utils/TableGen/Basic/SequenceToOffsetTable.h",
694 "utils/TableGen/Basic/TableGen.cpp",
695 "utils/TableGen/Basic/TableGen.h",
696 "utils/TableGen/Basic/VTEmitter.cpp",
697 "utils/TableGen/llvm-min-tblgen.cpp",
698 ],
699 copts = llvm_copts,
700 stamp = 0,
701 deps = [
702 ":Support",
703 ":TableGen",
704 ":config",
705 ],
706 )
707
708 cc_library(
709 name = "TableGenGlobalISel",
710 srcs = [
711 "utils/TableGen/Common/GlobalISel/CodeExpander.cpp",
712 ],
713 hdrs = [
714 # We have to include these headers here as well as in the `hdrs` below
715 # to allow the `.cpp` files to use file-relative-inclusion to find
716 # them, even though consumers of this library use inclusion relative to
717 # `utils/TableGen` with the `strip_includes_prefix` of this library.
718 # This mixture appears to be incompatible with header modules.
719 "utils/TableGen/Common/GlobalISel/CodeExpander.h",
720 "utils/TableGen/Common/GlobalISel/CodeExpansions.h",
721 ],
722 copts = llvm_copts,
723 features = ["-header_modules"],
724 strip_include_prefix = "utils/TableGen",
725 deps = [
726 ":CodeGenTypes",
727 ":Support",
728 ":TableGen",
729 ":config",
730 ],
731 )
732
733 cc_library(
734 name = "llvm-tblgen-headers",
735 textual_hdrs = glob(["utils/TableGen/*.def"]),
736 )
737
738 cc_binary(
739 name = "llvm-tblgen",
740 srcs = glob(
741 [
742 "utils/TableGen/*.cpp",
743 "utils/TableGen/*.h",
744 "utils/TableGen/Basic/*.cpp",
745 "utils/TableGen/Basic/*.h",
746 "utils/TableGen/Common/*.cpp",
747 "utils/TableGen/Common/*.h",
748 "utils/TableGen/Common/GlobalISel/*.cpp",
749 "utils/TableGen/Common/GlobalISel/*.h",
750
751 # Some tablegen sources include headers from MC, so these have to be
752 # listed here. MC uses headers produced by tablegen, so it cannot be a
753 # regular dependency.
754 "include/llvm/MC/*.h",
755 ],
756 exclude = [
757 "utils/TableGen/Common/GlobalISel/CodeExpander.cpp",
758 "utils/TableGen/llvm-min-tblgen.cpp",
759 ],
760 ) + [
761 "include/llvm/TargetParser/SubtargetFeature.h",
762 ],
763 copts = llvm_copts,
764 includes = ["utils/TableGen"],
765 stamp = 0,
766 deps = [
767 ":CodeGenTypes",
768 ":Support",
769 ":TableGen",
770 ":TableGenGlobalISel",
771 ":TargetParser",
772 ":config",
773 ":llvm-tblgen-headers",
774 ":vt_gen",
775 ],
776 )
777
778 gentbl_cc_library(
779 name = "intrinsic_enums_gen",
780 tbl_outs = {"include/llvm/IR/IntrinsicEnums.inc": ["-gen-intrinsic-enums"]},
781 tblgen = ":llvm-min-tblgen",
782 td_file = "include/llvm/IR/Intrinsics.td",
783 deps = [":CommonTargetTdFiles"],
784 )
785
786 gentbl_cc_library(
787 name = "intrinsics_impl_gen",
788 tbl_outs = {"include/llvm/IR/IntrinsicImpl.inc": ["-gen-intrinsic-impl"]},
789 tblgen = ":llvm-min-tblgen",
790 td_file = "include/llvm/IR/Intrinsics.td",
791 deps = [":CommonTargetTdFiles"],
792 )
793
794 gentbl_cc_library(
795 name = "runtime_libcalls_gen",
796 tbl_outs = {"include/llvm/IR/RuntimeLibcalls.inc": ["-gen-runtime-libcalls"]},
797 tblgen = ":llvm-min-tblgen",
798 td_file = "include/llvm/IR/RuntimeLibcalls.td",
799 deps = [
800 ":IRTdFiles",
801 ":TableGenTdFiles",
802 ],
803 )
804
805 gentbl_cc_library(
806 name = "vt_gen",
807 tbl_outs = {"include/llvm/CodeGen/GenVT.inc": ["-gen-vt"]},
808 tblgen = ":llvm-min-tblgen",
809 td_file = "include/llvm/CodeGen/ValueTypes.td",
810 )
811
812 # Note that the intrinsics are not currently set up so they can be pruned for
813 # disabled targets.
814 llvm_target_intrinsics_list = [
815 {
816 "name": "AArch64",
817 "intrinsic_prefix": "aarch64",
818 },
819 {
820 "name": "AMDGPU",
821 "intrinsic_prefix": "amdgcn",
822 },
823 {
824 "name": "ARM",
825 "intrinsic_prefix": "arm",
826 },
827 {
828 "name": "BPF",
829 "intrinsic_prefix": "bpf",
830 },
831 {
832 "name": "DirectX",
833 "intrinsic_prefix": "dx",
834 },
835 {
836 "name": "Hexagon",
837 "intrinsic_prefix": "hexagon",
838 },
839 {
840 "name": "LoongArch",
841 "intrinsic_prefix": "loongarch",
842 },
843 {
844 "name": "Mips",
845 "intrinsic_prefix": "mips",
846 },
847 {
848 "name": "NVPTX",
849 "intrinsic_prefix": "nvvm",
850 },
851 {
852 "name": "PowerPC",
853 "intrinsic_prefix": "ppc",
854 },
855 {
856 "name": "R600",
857 "intrinsic_prefix": "r600",
858 },
859 {
860 "name": "RISCV",
861 "intrinsic_prefix": "riscv",
862 },
863 {
864 "name": "S390",
865 "intrinsic_prefix": "s390",
866 },
867 {
868 "name": "SPIRV",
869 "intrinsic_prefix": "spv",
870 },
871 {
872 "name": "VE",
873 "intrinsic_prefix": "ve",
874 },
875 {
876 "name": "WebAssembly",
877 "intrinsic_prefix": "wasm",
878 },
879 {
880 "name": "X86",
881 "intrinsic_prefix": "x86",
882 },
883 {
884 "name": "XCore",
885 "intrinsic_prefix": "xcore",
886 },
887 ]
888
889 [[
890 gentbl_cc_library(
891 name = "intrinsic_" + target["name"] + "_gen",
892 includes = ["include"],
893 tbl_outs = {"include/llvm/IR/Intrinsics" + target["name"] + ".h": [
894 "-gen-intrinsic-enums",
895 "-intrinsic-prefix=" + target["intrinsic_prefix"],
896 ]},
897 tblgen = ":llvm-min-tblgen",
898 td_file = "include/llvm/IR/Intrinsics.td",
899 deps = [
900 ":CodegenTdFiles",
901 ":IRTdFiles",
902 ],
903 ),
904 ] for target in llvm_target_intrinsics_list]
905
906 gentbl_cc_library(
907 name = "attributes_gen",
908 tbl_outs = {"include/llvm/IR/Attributes.inc": ["-gen-attrs"]},
909 tblgen = ":llvm-min-tblgen",
910 td_file = "include/llvm/IR/Attributes.td",
911 )
912
913 cc_library(
914 name = "BitstreamReader",
915 srcs = glob([
916 "lib/Bitstream/Reader/*.cpp",
917 ]),
918 hdrs = [
919 "include/llvm/Bitstream/BitCodeEnums.h",
920 "include/llvm/Bitstream/BitCodes.h",
921 "include/llvm/Bitstream/BitstreamReader.h",
922 ],
923 copts = llvm_copts,
924 deps = [
925 ":Support",
926 ],
927 )
928
929 cc_library(
930 name = "BitstreamWriter",
931 hdrs = [
932 "include/llvm/Bitstream/BitCodeEnums.h",
933 "include/llvm/Bitstream/BitCodes.h",
934 "include/llvm/Bitstream/BitstreamWriter.h",
935 ],
936 copts = llvm_copts,
937 deps = [
938 ":Support",
939 ],
940 )
941
942 cc_library(
943 name = "Remarks",
944 srcs = glob(
945 [
946 "lib/Remarks/*.cpp",
947 "lib/Remarks/*.h",
948 ],
949 exclude = ["lib/Remarks/RemarkLinker.cpp"],
950 ),
951 hdrs = glob(
952 [
953 "include/llvm/Remarks/*.h",
954 ],
955 exclude = ["include/llvm/Remarks/RemarkLinker.h"],
956 ) + [
957 "include/llvm-c/Remarks.h",
958 ],
959 copts = llvm_copts,
960 deps = [
961 ":BitstreamReader",
962 ":BitstreamWriter",
963 ":Support",
964 ],
965 )
966
967 cc_library(
968 name = "remark_linker",
969 srcs = ["lib/Remarks/RemarkLinker.cpp"],
970 hdrs = ["include/llvm/Remarks/RemarkLinker.h"],
971 copts = llvm_copts,
972 deps = [
973 ":Object",
974 ":Remarks",
975 ":Support",
976 ],
977 )
978
979 filegroup(
980 name = "llvm_intrinsics_headers",
981 srcs = [
982 "include/llvm/IR/Intrinsics" + target["name"] + ".h"
983 for target in llvm_target_intrinsics_list
984 ],
985 )
986
987 cc_library(
988 name = "Core",
989 srcs = glob([
990 "lib/IR/*.cpp",
991 "lib/IR/*.h",
992 ]),
993 hdrs = glob(
994 [
995 "include/llvm/*.h",
996 "include/llvm/IR/*.h",
997 ],
998 exclude = [
999 "include/llvm/LinkAllPasses.h",
1000 ],
1001 ) + [
1002 "include/llvm-c/Comdat.h",
1003 "include/llvm-c/DebugInfo.h",
1004 "include/llvm/Analysis/SimplifyQuery.h",
1005 "include/llvm/Analysis/ValueTracking.h",
1006 "include/llvm/Analysis/WithCache.h",
1007 "include/llvm/ProfileData/InstrProf.h",
1008 "include/llvm/ProfileData/InstrProfData.inc",
1009 ] + [":llvm_intrinsics_headers"],
1010 copts = llvm_copts,
1011 textual_hdrs = glob([
1012 "include/llvm/IR/*.def",
1013 ]),
1014 deps = [
1015 ":BinaryFormat",
1016 ":Demangle",
1017 ":Remarks",
1018 ":Support",
1019 ":TargetParser",
1020 ":attributes_gen",
1021 ":config",
1022 ":intrinsic_enums_gen",
1023 ":intrinsics_impl_gen",
1024 ":runtime_libcalls_gen",
1025 ],
1026 )
1027
1028 cc_library(
1029 name = "BitReader",
1030 srcs = glob([
1031 "lib/Bitcode/Reader/*.cpp",
1032 "lib/Bitcode/Reader/*.h",
1033 ]),
1034 hdrs = [
1035 "include/llvm-c/BitReader.h",
1036 "include/llvm/Bitcode/BitcodeAnalyzer.h",
1037 "include/llvm/Bitcode/BitcodeCommon.h",
1038 "include/llvm/Bitcode/BitcodeReader.h",
1039 "include/llvm/Bitcode/LLVMBitCodes.h",
1040 ],
1041 copts = llvm_copts,
1042 deps = [
1043 ":BinaryFormat",
1044 ":BitstreamReader",
1045 ":Core",
1046 ":Support",
1047 ":TargetParser",
1048 ":config",
1049 ],
1050 )
1051
1052 cc_library(
1053 name = "MCParser",
1054 srcs = glob([
1055 "lib/MC/MCParser/*.cpp",
1056 ]),
1057 hdrs = glob(["include/llvm/MC/MCParser/*.h"]),
1058 copts = llvm_copts,
1059 deps = [
1060 ":BinaryFormat",
1061 ":DebugInfoCodeView",
1062 ":MC",
1063 ":Support",
1064 ":TargetParser",
1065 ":config",
1066 ],
1067 )
1068
1069 cc_library(
1070 name = "Telemetry",
1071 srcs = glob(["lib/Telemetry/*.cpp"]),
1072 hdrs = glob(["include/llvm/Telemetry/*.h"]),
1073 copts = llvm_copts,
1074 includes = ["include"],
1075 deps = [":Support"],
1076 )
1077
1078 cc_library(
1079 name = "TextAPI",
1080 srcs = glob(
1081 [
1082 "lib/TextAPI/**/*.cpp",
1083 ],
1084 exclude = ["lib/TextAPI/BinaryReader/**"],
1085 ),
1086 hdrs = glob(
1087 [
1088 "include/llvm/TextAPI/**/*.h",
1089 "include/llvm/TextAPI/**/*.def",
1090 "lib/TextAPI/**/*.h",
1091 ],
1092 exclude = [
1093 "lib/TextAPI/BinaryReader/**",
1094 "include/llvm/TextAPI/DylibReader.h",
1095 ],
1096 ),
1097 copts = llvm_copts,
1098 deps = [
1099 ":BinaryFormat",
1100 ":Support",
1101 ":TargetParser",
1102 ],
1103 )
1104
1105 cc_library(
1106 name = "TextAPIBinaryReader",
1107 srcs = glob([
1108 "lib/TextAPI/BinaryReader/**/*.cpp",
1109 ]),
1110 hdrs = ["include/llvm/TextAPI/DylibReader.h"],
1111 copts = llvm_copts,
1112 deps = [
1113 ":DebugInfoDWARF",
1114 ":Object",
1115 ":Support",
1116 ":TargetParser",
1117 ":TextAPI",
1118 ],
1119 )
1120
1121 cc_library(
1122 name = "ObjCopy",
1123 srcs = glob([
1124 "lib/ObjCopy/**/*.cpp",
1125 "lib/ObjCopy/**/*.h",
1126 ]),
1127 hdrs = glob([
1128 "include/llvm/ObjCopy/**/*.h",
1129 ]),
1130 copts = llvm_copts,
1131 includes = ["lib/ObjCopy"],
1132 deps = [
1133 ":BinaryFormat",
1134 ":MC",
1135 ":Object",
1136 ":ObjectYAML",
1137 ":Option",
1138 ":Support",
1139 ":Target",
1140 ":intrinsics_impl_gen",
1141 ],
1142 )
1143
1144 cc_library(
1145 name = "Object",
1146 srcs = glob([
1147 "lib/Object/*.cpp",
1148 "lib/Object/*.h",
1149 ]),
1150 hdrs = glob([
1151 "include/llvm/Object/*.h",
1152 ]) + [
1153 "include/llvm-c/Object.h",
1154 ],
1155 copts = llvm_copts,
1156 deps = [
1157 ":BinaryFormat",
1158 ":BitReader",
1159 ":Core",
1160 ":IRReader",
1161 ":MC",
1162 ":MCParser",
1163 ":Support",
1164 ":TargetParser",
1165 ":TextAPI",
1166 ":config",
1167 ],
1168 )
1169
1170 cc_library(
1171 name = "ObjectYAML",
1172 srcs = glob([
1173 "lib/ObjectYAML/*.cpp",
1174 ]),
1175 hdrs = glob(["include/llvm/ObjectYAML/*.h"]),
1176 copts = llvm_copts,
1177 deps = [
1178 ":BinaryFormat",
1179 ":DebugInfoCodeView",
1180 ":MC",
1181 ":Object",
1182 ":Support",
1183 ":TargetParser",
1184 ],
1185 )
1186
1187 cc_library(
1188 name = "ProfileData",
1189 srcs = glob([
1190 "lib/ProfileData/*.cpp",
1191 ]),
1192 hdrs = glob([
1193 "include/llvm/ProfileData/*.h",
1194 "include/llvm/ProfileData/*.inc",
1195 ]),
1196 copts = llvm_copts,
1197 deps = [
1198 ":BitstreamReader",
1199 ":BitstreamWriter",
1200 ":Core",
1201 ":DebugInfo",
1202 ":DebugInfoDWARF",
1203 ":DebugInfoDWARFLowLevel",
1204 ":Demangle",
1205 ":Object",
1206 ":Support",
1207 ":Symbolize",
1208 ":TargetParser",
1209 ":config",
1210 ],
1211 )
1212
1213 cc_library(
1214 name = "Coverage",
1215 srcs = glob([
1216 "lib/ProfileData/Coverage/*.cpp",
1217 ]),
1218 hdrs = glob(["include/llvm/ProfileData/Coverage/*.h"]),
1219 copts = llvm_copts,
1220 deps = [
1221 ":BinaryFormat",
1222 ":Object",
1223 ":ProfileData",
1224 ":Support",
1225 ":TargetParser",
1226 ],
1227 )
1228
1229 AnalysisFpExcSrcs = [
1230 "lib/Analysis/ConstantFolding.cpp",
1231 ]
1232
1233 cc_library(
1234 name = "AnalysisFpExc",
1235 srcs = AnalysisFpExcSrcs,
1236 hdrs = glob(
1237 [
1238 "include/llvm/Analysis/*.h",
1239 "include/llvm/Analysis/Utils/*.h",
1240 ],
1241 ),
1242 copts = llvm_copts + ["-ftrapping-math"],
1243 textual_hdrs = glob([
1244 "include/llvm/Analysis/*.def",
1245 ]),
1246 deps = [
1247 ":BinaryFormat",
1248 ":Core",
1249 ":Object",
1250 ":ProfileData",
1251 ":Support",
1252 ":TargetParser",
1253 ":config",
1254 ],
1255 )
1256
1257 cc_library(
1258 name = "Analysis",
1259 srcs = glob(
1260 [
1261 "lib/Analysis/*.cpp",
1262 ],
1263 exclude = AnalysisFpExcSrcs,
1264 ),
1265 hdrs = glob(
1266 [
1267 "include/llvm/Analysis/*.h",
1268 "include/llvm/Analysis/Utils/*.h",
1269 ],
1270 ) + [
1271 "include/llvm-c/Analysis.h",
1272 ],
1273 copts = llvm_copts,
1274 textual_hdrs = glob([
1275 "include/llvm/Analysis/*.def",
1276 ]),
1277 deps = [
1278 ":AnalysisFpExc",
1279 ":BinaryFormat",
1280 ":Core",
1281 ":Object",
1282 ":ProfileData",
1283 ":Support",
1284 ":TargetParser",
1285 ":config",
1286 ],
1287 )
1288
1289 cc_library(
1290 name = "BitWriter",
1291 srcs = glob([
1292 "lib/Bitcode/Writer/*.cpp",
1293 "lib/Bitcode/Writer/*.h",
1294 ]),
1295 hdrs = [
1296 "include/llvm-c/BitWriter.h",
1297 "include/llvm/Bitcode/BitcodeCommon.h",
1298 "include/llvm/Bitcode/BitcodeConvenience.h",
1299 "include/llvm/Bitcode/BitcodeWriter.h",
1300 "include/llvm/Bitcode/BitcodeWriterPass.h",
1301 "include/llvm/Bitcode/LLVMBitCodes.h",
1302 ],
1303 copts = llvm_copts,
1304 deps = [
1305 ":Analysis",
1306 ":BinaryFormat",
1307 ":BitReader",
1308 ":BitstreamWriter",
1309 ":Core",
1310 ":MC",
1311 ":Object",
1312 ":ProfileData",
1313 ":Support",
1314 ":TargetParser",
1315 ":config",
1316 ],
1317 )
1318
1319 cc_library(
1320 name = "Target",
1321 srcs = glob([
1322 "lib/Target/*.cpp",
1323 ]),
1324 hdrs = glob([
1325 "include/llvm/Target/*.h",
1326 ]) + [
1327 "include/llvm-c/Target.h",
1328 "include/llvm-c/TargetMachine.h",
1329 ],
1330 copts = llvm_copts,
1331 deps = [
1332 ":Analysis",
1333 ":BinaryFormat",
1334 ":Core",
1335 ":MC",
1336 ":Support",
1337 ":TargetParser",
1338 ":config",
1339 ],
1340 )
1341
1342 filegroup(
1343 name = "common_target_td_sources",
1344 srcs = glob([
1345 "include/llvm/CodeGen/*.td",
1346 "include/llvm/Frontend/Directive/*.td",
1347 "include/llvm/IR/Intrinsics*.td",
1348 "include/llvm/TableGen/*.td",
1349 "include/llvm/Target/*.td",
1350 "include/llvm/Target/GlobalISel/*.td",
1351 ]),
1352 )
1353
1354 td_library(
1355 name = "CodegenTdFiles",
1356 srcs = glob(["include/llvm/CodeGen/*.td"]),
1357 includes = ["include"],
1358 )
1359
1360 td_library(
1361 name = "IRTdFiles",
1362 srcs = glob(["include/llvm/IR/*.td"]),
1363 includes = ["include"],
1364 )
1365
1366 td_library(
1367 name = "TableGenTdFiles",
1368 srcs = glob(["include/llvm/TableGen/*.td"]),
1369 includes = ["include"],
1370 )
1371
1372 td_library(
1373 name = "CommonTargetTdFiles",
1374 srcs = [":common_target_td_sources"],
1375 includes = ["include"],
1376 )
1377
1378 td_library(
1379 name = "ArmTargetTdFiles",
1380 srcs = glob([
1381 "lib/Target/ARM/**/*.td",
1382 ]),
1383 )
1384
1385 gentbl_cc_library(
1386 name = "ARMTargetParserDefGen",
1387 tbl_outs = {"include/llvm/TargetParser/ARMTargetParserDef.inc": ["-gen-arm-target-def"]},
1388 tblgen = ":llvm-min-tblgen",
1389 td_file = "lib/Target/ARM/ARM.td",
1390 deps = [
1391 ":ArmTargetTdFiles",
1392 ":CommonTargetTdFiles",
1393 ],
1394 )
1395
1396 td_library(
1397 name = "AArch64TargetTdFiles",
1398 srcs = glob([
1399 "lib/Target/AArch64/**/*.td",
1400 ]),
1401 )
1402
1403 gentbl_cc_library(
1404 name = "AArch64TargetParserDefGen",
1405 tbl_outs = {"include/llvm/TargetParser/AArch64TargetParserDef.inc": ["-gen-arm-target-def"]},
1406 tblgen = ":llvm-min-tblgen",
1407 td_file = "lib/Target/AArch64/AArch64.td",
1408 deps = [
1409 ":AArch64TargetTdFiles",
1410 ":CommonTargetTdFiles",
1411 ],
1412 )
1413
1414 td_library(
1415 name = "RISCVTargetTdFiles",
1416 srcs = glob([
1417 "lib/Target/RISCV/**/*.td",
1418 ]),
1419 )
1420
1421 td_library(
1422 name = "PPCTargetTdFiles",
1423 srcs = glob([
1424 "lib/Target/PowerPC/**/*.td",
1425 ]),
1426 )
1427
1428 gentbl_cc_library(
1429 name = "RISCVTargetParserDefGen",
1430 tbl_outs = {"include/llvm/TargetParser/RISCVTargetParserDef.inc": ["-gen-riscv-target-def"]},
1431 tblgen = ":llvm-min-tblgen",
1432 td_file = "lib/Target/RISCV/RISCV.td",
1433 deps = [
1434 ":CommonTargetTdFiles",
1435 ":RISCVTargetTdFiles",
1436 ],
1437 )
1438
1439 gentbl_cc_library(
1440 name = "PPCGenTargetFeaturesGen",
1441 tbl_outs = {"include/llvm/TargetParser/PPCGenTargetFeatures.inc": ["-gen-target-features"]},
1442 tblgen = ":llvm-tblgen",
1443 td_file = "lib/Target/PowerPC/PPC.td",
1444 deps = [
1445 ":CommonTargetTdFiles",
1446 ":PPCTargetTdFiles",
1447 ],
1448 )
1449
1450 cc_library(
1451 name = "PPCTargetParser",
1452 srcs = ["lib/TargetParser/PPCTargetParser.cpp"],
1453 hdrs = ["include/llvm/TargetParser/PPCTargetParser.h"],
1454 copts = llvm_copts,
1455 includes = ["include"],
1456 deps = [
1457 ":PPCGenTargetFeaturesGen",
1458 ":Support",
1459 ":TargetParser",
1460 ],
1461 )
1462
1463 cc_library(
1464 name = "TargetParser",
1465 srcs = glob(
1466 [
1467 "lib/TargetParser/*.cpp",
1468 ],
1469 exclude = ["lib/TargetParser/PPCTargetParser.cpp"],
1470 ) + select({
1471 "@platforms//os:windows": glob([
1472 "lib/TargetParser/Windows/*.inc",
1473 ]),
1474 "//conditions:default": glob([
1475 "lib/TargetParser/Unix/*.inc",
1476 ]),
1477 }),
1478 hdrs = glob([
1479 "include/llvm/TargetParser/*.h",
1480 ]),
1481 copts = llvm_copts,
1482 includes = ["include"],
1483 textual_hdrs = [
1484 "include/llvm/TargetParser/AArch64CPUFeatures.inc",
1485 "include/llvm/TargetParser/AArch64FeatPriorities.inc",
1486 "include/llvm/TargetParser/AArch64TargetParserDef.inc",
1487 "include/llvm/TargetParser/ARMTargetParserDef.inc",
1488 "include/llvm/TargetParser/RISCVTargetParserDef.inc",
1489 ] + glob([
1490 "include/llvm/TargetParser/*.def",
1491 ]),
1492 deps = [
1493 ":Support",
1494 ":config",
1495 ],
1496 )
1497
1498 cc_library(
1499 name = "DWP",
1500 srcs = glob([
1501 "lib/DWP/*.cpp",
1502 ]),
1503 hdrs = glob(["include/llvm/DWP/*.h"]),
1504 copts = llvm_copts,
1505 deps = [
1506 ":DebugInfoDWARF",
1507 ":MC",
1508 ":Object",
1509 ":Support",
1510 ":Target",
1511 ],
1512 )
1513
1514 cc_library(
1515 name = "TransformUtils",
1516 srcs = glob([
1517 "lib/Transforms/Utils/*.cpp",
1518 ]),
1519 hdrs = glob(["include/llvm/Transforms/Utils/*.h"]) + [
1520 "include/llvm/Transforms/Utils.h",
1521 ],
1522 copts = llvm_copts,
1523 deps = [
1524 ":Analysis",
1525 ":BinaryFormat",
1526 ":BitWriter",
1527 ":Core",
1528 ":ProfileData",
1529 ":Support",
1530 ":Target",
1531 ":TargetParser",
1532 ":config",
1533 ],
1534 )
1535
1536 td_library(
1537 name = "AMDGPUTargetTdFiles",
1538 srcs = glob([
1539 "lib/Target/AMDGPU/**/*.td",
1540 ]),
1541 )
1542
1543 gentbl_cc_library(
1544 name = "InstCombineTableGen",
1545 strip_include_prefix = "lib/Target/AMDGPU",
1546 tbl_outs = {"lib/Target/AMDGPU/InstCombineTables.inc": ["-gen-searchable-tables"]},
1547 tblgen = ":llvm-tblgen",
1548 td_file = "lib/Target/AMDGPU/InstCombineTables.td",
1549 deps = [
1550 ":AMDGPUTargetTdFiles",
1551 ":CommonTargetTdFiles",
1552 ],
1553 )
1554
1555 cc_library(
1556 name = "InstCombine",
1557 srcs = glob([
1558 "lib/Transforms/InstCombine/*.cpp",
1559 "lib/Transforms/InstCombine/*.h",
1560 ]),
1561 hdrs = glob(["include/llvm/Transforms/InstCombine/*.h"]),
1562 copts = llvm_copts,
1563 deps = [
1564 ":Analysis",
1565 ":Core",
1566 ":Support",
1567 ":Target",
1568 ":TransformUtils",
1569 ":config",
1570 ],
1571 )
1572
1573 cc_library(
1574 name = "AggressiveInstCombine",
1575 srcs = glob([
1576 "lib/Transforms/AggressiveInstCombine/*.cpp",
1577 "lib/Transforms/AggressiveInstCombine/*.h",
1578 ]),
1579 hdrs = [
1580 "include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h",
1581 ],
1582 copts = llvm_copts,
1583 deps = [
1584 ":Analysis",
1585 ":Core",
1586 ":Support",
1587 ":TransformUtils",
1588 ],
1589 )
1590
1591 cc_library(
1592 name = "Instrumentation",
1593 srcs = glob([
1594 "lib/Transforms/Instrumentation/*.cpp",
1595 "lib/Transforms/Instrumentation/*.h",
1596 "lib/Transforms/Instrumentation/*.inc",
1597 ]),
1598 hdrs = glob(["include/llvm/Transforms/Instrumentation/*.h"]) + [
1599 "include/llvm/Transforms/Utils/Instrumentation.h",
1600 ],
1601 copts = llvm_copts,
1602 deps = [
1603 ":Analysis",
1604 ":BinaryFormat",
1605 ":Core",
1606 ":Demangle",
1607 ":MC",
1608 ":ProfileData",
1609 ":Scalar",
1610 ":Support",
1611 ":Target",
1612 ":TargetParser",
1613 ":TransformUtils",
1614 ":config",
1615 ],
1616 )
1617
1618 cc_library(
1619 name = "ObjCARC",
1620 srcs = glob([
1621 "lib/Transforms/ObjCARC/*.cpp",
1622 "lib/Transforms/ObjCARC/*.h",
1623 ]),
1624 hdrs = ["include/llvm/Transforms/ObjCARC.h"],
1625 copts = llvm_copts,
1626 deps = [
1627 ":Analysis",
1628 ":Core",
1629 ":Support",
1630 ":Target",
1631 ":TargetParser",
1632 ":TransformUtils",
1633 ":config",
1634 ],
1635 )
1636
1637 cc_library(
1638 name = "SandboxIR",
1639 srcs = glob([
1640 "lib/SandboxIR/*.cpp",
1641 ]),
1642 hdrs = glob(["include/llvm/SandboxIR/*.h"]),
1643 copts = llvm_copts,
1644 textual_hdrs = ["include/llvm/SandboxIR/Values.def"],
1645 deps = [
1646 ":Analysis",
1647 ":Core",
1648 ":Support",
1649 ],
1650 )
1651
1652 cc_library(
1653 name = "Scalar",
1654 srcs = glob([
1655 "lib/Transforms/Scalar/*.cpp",
1656 ]),
1657 hdrs = glob(["include/llvm/Transforms/Scalar/*.h"]) + [
1658 "include/llvm/Transforms/Scalar.h",
1659 ],
1660 copts = llvm_copts,
1661 deps = [
1662 ":AggressiveInstCombine",
1663 ":Analysis",
1664 ":BinaryFormat",
1665 ":Core",
1666 ":InstCombine",
1667 ":ProfileData",
1668 ":Support",
1669 ":Target",
1670 ":TransformUtils",
1671 ":config",
1672 ],
1673 )
1674
1675 cc_library(
1676 name = "Vectorize",
1677 srcs = glob([
1678 "lib/Transforms/Vectorize/**/*.cpp",
1679 "lib/Transforms/Vectorize/**/*.h",
1680 ]),
1681 hdrs = glob([
1682 "include/llvm/Transforms/Vectorize/**/*.h",
1683 ]),
1684 copts = llvm_copts,
1685 textual_hdrs = [
1686 "lib/Transforms/Vectorize/SandboxVectorizer/Passes/PassRegistry.def",
1687 ],
1688 deps = [
1689 ":Analysis",
1690 ":Core",
1691 ":SandboxIR",
1692 ":Scalar",
1693 ":Support",
1694 ":Target",
1695 ":TransformUtils",
1696 ":config",
1697 ],
1698 )
1699
1700 cc_library(
1701 name = "FrontendDebug",
1702 hdrs = glob([
1703 "include/llvm/Frontend/Debug/*.h",
1704 ]),
1705 copts = llvm_copts,
1706 deps = [
1707 ":Support",
1708 ],
1709 )
1710
1711 cc_library(
1712 name = "FrontendDriver",
1713 srcs = glob([
1714 "lib/Frontend/Driver/*.cpp",
1715 ]),
1716 hdrs = glob([
1717 "include/llvm/Frontend/Driver/*.h",
1718 ]),
1719 copts = llvm_copts,
1720 deps = [
1721 ":Analysis",
1722 ":ProfileData",
1723 ":Support",
1724 ":TargetParser",
1725 ],
1726 )
1727
1728 cc_library(
1729 name = "FrontendHLSL",
1730 srcs = glob([
1731 "lib/Frontend/HLSL/*.cpp",
1732 ]),
1733 hdrs = glob([
1734 "include/llvm/Frontend/HLSL/*.h",
1735 ]),
1736 copts = llvm_copts,
1737 deps = [
1738 ":BinaryFormat",
1739 ":Core",
1740 ":Support",
1741 ],
1742 )
1743
1744 cc_library(
1745 name = "FrontendOffloading",
1746 srcs = glob([
1747 "lib/Frontend/Offloading/*.cpp",
1748 ]),
1749 hdrs = glob([
1750 "include/llvm/Frontend/Offloading/*.h",
1751 ]),
1752 copts = llvm_copts,
1753 deps = [
1754 ":BinaryFormat",
1755 ":Core",
1756 ":Object",
1757 ":ObjectYAML",
1758 ":Support",
1759 ":TargetParser",
1760 ":TransformUtils",
1761 ],
1762 )
1763
1764 td_library(
1765 name = "OmpTdFiles",
1766 srcs = glob([
1767 "include/llvm/Frontend/OpenMP/*.td",
1768 "include/llvm/Frontend/Directive/*.td",
1769 ]),
1770 includes = ["include"],
1771 )
1772
1773 gentbl_filegroup(
1774 name = "omp_gen",
1775 tbl_outs = {"include/llvm/Frontend/OpenMP/OMP.h.inc": ["--gen-directive-decl"]},
1776 tblgen = ":llvm-min-tblgen",
1777 td_file = "include/llvm/Frontend/OpenMP/OMP.td",
1778 deps = [":OmpTdFiles"],
1779 )
1780
1781 gentbl_filegroup(
1782 name = "omp_gen_impl",
1783 tbl_outs = {"include/llvm/Frontend/OpenMP/OMP.inc": ["--gen-directive-impl"]},
1784 tblgen = ":llvm-min-tblgen",
1785 td_file = "include/llvm/Frontend/OpenMP/OMP.td",
1786 deps = [":OmpTdFiles"],
1787 )
1788
1789 cc_library(
1790 name = "FrontendAtomic",
1791 srcs = glob([
1792 "lib/Frontend/Atomic/*.cpp",
1793 ]),
1794 hdrs = glob([
1795 "include/llvm/Frontend/Atomic/*.h",
1796 ]),
1797 copts = llvm_copts,
1798 deps = [
1799 ":Core",
1800 ":Support",
1801 ],
1802 )
1803
1804 cc_library(
1805 name = "FrontendOpenMP",
1806 srcs = glob([
1807 "lib/Frontend/OpenMP/*.cpp",
1808 ]),
1809 hdrs = glob([
1810 "include/llvm/Frontend/OpenMP/*.h",
1811 ]) + [
1812 "include/llvm/Frontend/OpenMP/OMP.h.inc",
1813 "include/llvm/Frontend/OpenMP/OMP.inc",
1814 ],
1815 copts = llvm_copts,
1816 textual_hdrs = glob([
1817 "include/llvm/Frontend/OpenMP/*.def",
1818 ]),
1819 deps = [
1820 ":Analysis",
1821 ":BitReader",
1822 ":Core",
1823 ":Demangle",
1824 ":FrontendAtomic",
1825 ":FrontendDirective",
1826 ":FrontendOffloading",
1827 ":MC",
1828 ":Scalar",
1829 ":Support",
1830 ":Target",
1831 ":TargetParser",
1832 ":TransformUtils",
1833 ],
1834 )
1835
1836 td_library(
1837 name = "AccTdFiles",
1838 srcs = glob([
1839 "include/llvm/Frontend/OpenACC/*.td",
1840 "include/llvm/Frontend/Directive/*.td",
1841 ]),
1842 includes = ["include"],
1843 )
1844
1845 gentbl_filegroup(
1846 name = "acc_gen",
1847 tbl_outs = {"include/llvm/Frontend/OpenACC/ACC.h.inc": ["--gen-directive-decl"]},
1848 tblgen = ":llvm-min-tblgen",
1849 td_file = "include/llvm/Frontend/OpenACC/ACC.td",
1850 deps = [":AccTdFiles"],
1851 )
1852
1853 gentbl_filegroup(
1854 name = "acc_gen_impl",
1855 tbl_outs = {"include/llvm/Frontend/OpenACC/ACC.inc": ["--gen-directive-impl"]},
1856 tblgen = ":llvm-min-tblgen",
1857 td_file = "include/llvm/Frontend/OpenACC/ACC.td",
1858 deps = [":AccTdFiles"],
1859 )
1860
1861 cc_library(
1862 name = "FrontendDirective",
1863 srcs = glob(["lib/Frontend/Directive/*.cpp"]),
1864 hdrs = glob(["include/llvm/Frontend/Directive/*.h"]),
1865 deps = [":Support"],
1866 )
1867
1868 cc_library(
1869 name = "FrontendOpenACC",
1870 srcs = glob([
1871 "lib/Frontend/OpenACC/*.cpp",
1872 ]) + [
1873 "include/llvm/Frontend/OpenACC/ACC.inc",
1874 ],
1875 hdrs = ["include/llvm/Frontend/OpenACC/ACC.h.inc"],
1876 copts = llvm_copts,
1877 deps = [
1878 ":Analysis",
1879 ":Core",
1880 ":FrontendDirective",
1881 ":Support",
1882 ":TransformUtils",
1883 ],
1884 )
1885
1886 cc_library(
1887 name = "AsmParser",
1888 srcs = glob([
1889 "lib/AsmParser/*.cpp",
1890 ]),
1891 hdrs = glob(["include/llvm/AsmParser/*.h"]),
1892 copts = llvm_copts,
1893 deps = [
1894 ":BinaryFormat",
1895 ":Core",
1896 ":Support",
1897 ":attributes_gen",
1898 ],
1899 )
1900
1901 cc_library(
1902 name = "IRPrinter",
1903 srcs = glob([
1904 "lib/IRPrinter/*.cpp",
1905 ]),
1906 hdrs = glob([
1907 "include/llvm/IRPrinter/*.h",
1908 ]),
1909 copts = llvm_copts,
1910 deps = [
1911 ":Analysis",
1912 ":Core",
1913 ":Support",
1914 ],
1915 )
1916
1917 cc_library(
1918 name = "IRReader",
1919 srcs = glob([
1920 "lib/IRReader/*.cpp",
1921 ]),
1922 hdrs = glob([
1923 "include/llvm/IRReader/*.h",
1924 ]) + [
1925 "include/llvm-c/IRReader.h",
1926 ],
1927 copts = llvm_copts,
1928 deps = [
1929 ":AsmParser",
1930 ":BitReader",
1931 ":Core",
1932 ":Support",
1933 ":config",
1934 ],
1935 )
1936
1937 cc_library(
1938 name = "Linker",
1939 srcs = glob([
1940 "lib/Linker/*.cpp",
1941 "lib/Linker/*.h",
1942 ]),
1943 hdrs = glob([
1944 "include/llvm/Linker/*.h",
1945 ]) + [
1946 "include/llvm-c/Linker.h",
1947 ],
1948 copts = llvm_copts,
1949 deps = [
1950 ":Core",
1951 ":Object",
1952 ":Support",
1953 ":TargetParser",
1954 ":TransformUtils",
1955 ":config",
1956 ],
1957 )
1958
1959 cc_library(
1960 name = "IPO",
1961 srcs = glob([
1962 "lib/Transforms/IPO/*.cpp",
1963 ]),
1964 hdrs = glob([
1965 "include/llvm/Transforms/IPO/*.h",
1966 ]) + [
1967 "include/llvm/Transforms/IPO.h",
1968 ],
1969 copts = llvm_copts,
1970 deps = [
1971 ":AggressiveInstCombine",
1972 ":Analysis",
1973 ":BinaryFormat",
1974 ":BitReader",
1975 ":BitWriter",
1976 ":Core",
1977 ":Demangle",
1978 ":FrontendOpenMP",
1979 ":IRPrinter",
1980 ":IRReader",
1981 ":InstCombine",
1982 ":Instrumentation",
1983 ":Linker",
1984 ":ObjCARC",
1985 ":Object",
1986 ":ProfileData",
1987 ":Scalar",
1988 ":Support",
1989 ":Target",
1990 ":TargetParser",
1991 ":TransformUtils",
1992 ":Vectorize",
1993 ":config",
1994 ":ir_headers",
1995 ],
1996 )
1997
1998 cc_library(
1999 name = "CFGuard",
2000 srcs = glob([
2001 "lib/Transforms/CFGuard/*.cpp",
2002 ]),
2003 hdrs = ["include/llvm/Transforms/CFGuard.h"],
2004 copts = llvm_copts,
2005 deps = [
2006 ":Core",
2007 ":Support",
2008 ":TargetParser",
2009 ],
2010 )
2011
2012 cc_library(
2013 name = "HipStdPar",
2014 srcs = glob([
2015 "lib/Transforms/HipStdPar/*.cpp",
2016 ]),
2017 hdrs = ["include/llvm/Transforms/HipStdPar/HipStdPar.h"],
2018 copts = llvm_copts,
2019 deps = [
2020 ":Analysis",
2021 ":Core",
2022 ":Support",
2023 ":TargetParser",
2024 ":TransformUtils",
2025 ],
2026 )
2027
2028 cc_library(
2029 name = "Coroutines",
2030 srcs = glob([
2031 "lib/Transforms/Coroutines/*.cpp",
2032 "lib/Transforms/Coroutines/*.h",
2033 ]),
2034 hdrs = glob(["include/llvm/Transforms/Coroutines/*.h"]),
2035 copts = llvm_copts,
2036 deps = [
2037 ":Analysis",
2038 ":BinaryFormat",
2039 ":Core",
2040 ":IPO",
2041 ":Scalar",
2042 ":Support",
2043 ":TransformUtils",
2044 ":config",
2045 ],
2046 )
2047
2048 # Meta-target for clients which depend on all of the transforms libraries.
2049 cc_library(
2050 name = "common_transforms",
2051 deps = [
2052 ":AggressiveInstCombine",
2053 ":CFGuard",
2054 ":Coroutines",
2055 ":IPO",
2056 ":InstCombine",
2057 ":Instrumentation",
2058 ":ObjCARC",
2059 ":Scalar",
2060 ":Vectorize",
2061 ],
2062 )
2063
2064 cc_library(
2065 name = "asm_printer_defs",
2066 copts = llvm_copts,
2067 textual_hdrs = glob(["lib/CodeGen/AsmPrinter/*.def"]),
2068 )
2069
2070 cc_library(
2071 name = "CodeGenTypes",
2072 srcs = glob([
2073 "lib/CodeGenTypes/**/*.cpp",
2074 ]),
2075 hdrs = glob([
2076 "include/llvm/CodeGenTypes/**/*.h",
2077 ]),
2078 copts = llvm_copts,
2079 deps = [
2080 ":Support",
2081 ":vt_gen",
2082 ],
2083 )
2084
2085 cc_library(
2086 name = "CGData",
2087 srcs = glob(["lib/CGData/**/*.cpp"]),
2088 hdrs = glob([
2089 "include/llvm/CGData/**/*.h",
2090 "include/llvm/CGData/**/*.inc",
2091 ]),
2092 copts = llvm_copts,
2093 deps = [
2094 ":BitReader",
2095 ":BitWriter",
2096 ":Core",
2097 ":Object",
2098 ":ObjectYAML",
2099 ":Support",
2100 ":TargetParser",
2101 ],
2102 )
2103
2104 cc_library(
2105 name = "CodeGen",
2106 srcs = glob(
2107 [
2108 "lib/CodeGen/**/*.cpp",
2109 "lib/CodeGen/**/*.h",
2110 "lib/CodeGen/SelectionDAG/*.cpp",
2111 "lib/CodeGen/SelectionDAG/*.h",
2112 ],
2113 ),
2114 hdrs = [
2115 "include/llvm/LinkAllPasses.h",
2116 ] + glob(
2117 [
2118 "include/llvm/CodeGen/**/*.h",
2119 ],
2120 ),
2121 copts = llvm_copts,
2122 textual_hdrs = glob([
2123 "include/llvm/CodeGen/**/*.def",
2124 ]),
2125 deps = [
2126 ":AggressiveInstCombine",
2127 ":Analysis",
2128 ":AsmParser",
2129 ":BinaryFormat",
2130 ":BitReader",
2131 ":BitWriter",
2132 ":CFGuard",
2133 ":CGData",
2134 ":CodeGenTypes",
2135 ":Core",
2136 ":DebugInfoCodeView",
2137 ":DebugInfoDWARF",
2138 ":DebugInfoDWARFLowLevel",
2139 ":IPO",
2140 ":IRPrinter",
2141 ":Instrumentation",
2142 ":MC",
2143 ":MCParser",
2144 ":ObjCARC",
2145 ":Object",
2146 ":ProfileData",
2147 ":Remarks",
2148 ":Scalar",
2149 ":Support",
2150 ":Target",
2151 ":TargetParser",
2152 ":TransformUtils",
2153 ":asm_printer_defs",
2154 ":config",
2155 ":vt_gen",
2156 ],
2157 )
2158
2159 cc_library(
2160 name = "MCDisassembler",
2161 srcs = glob([
2162 "lib/MC/MCDisassembler/*.cpp",
2163 "lib/MC/MCDisassembler/*.h",
2164 ]),
2165 hdrs = glob([
2166 "include/llvm/MC/MCDisassembler/*.h",
2167 ]) + [
2168 "include/llvm-c/Disassembler.h",
2169 ],
2170 copts = llvm_copts,
2171 deps = [
2172 ":BinaryFormat",
2173 ":MC",
2174 ":Support",
2175 ":TargetParser",
2176 ":config",
2177 ],
2178 )
2179
2180 llvm_target_lib_list = [lib for lib in [
2181 {
2182 "name": "AArch64",
2183 "short_name": "AArch64",
2184 "tbl_outs": {
2185 "lib/Target/AArch64/AArch64GenRegisterBank.inc": ["-gen-register-bank"],
2186 "lib/Target/AArch64/AArch64GenRegisterInfo.inc": ["-gen-register-info"],
2187 "lib/Target/AArch64/AArch64GenInstrInfo.inc": ["-gen-instr-info"],
2188 "lib/Target/AArch64/AArch64GenMCCodeEmitter.inc": ["-gen-emitter"],
2189 "lib/Target/AArch64/AArch64GenMCPseudoLowering.inc": ["-gen-pseudo-lowering"],
2190 "lib/Target/AArch64/AArch64GenAsmWriter.inc": ["-gen-asm-writer"],
2191 "lib/Target/AArch64/AArch64GenAsmWriter1.inc": [
2192 "-gen-asm-writer",
2193 "-asmwriternum=1",
2194 ],
2195 "lib/Target/AArch64/AArch64GenAsmMatcher.inc": ["-gen-asm-matcher"],
2196 "lib/Target/AArch64/AArch64GenDAGISel.inc": ["-gen-dag-isel"],
2197 "lib/Target/AArch64/AArch64GenFastISel.inc": ["-gen-fast-isel"],
2198 "lib/Target/AArch64/AArch64GenGlobalISel.inc": ["-gen-global-isel"],
2199 "lib/Target/AArch64/AArch64GenO0PreLegalizeGICombiner.inc": [
2200 "-gen-global-isel-combiner",
2201 "-combiners=AArch64O0PreLegalizerCombiner",
2202 ],
2203 "lib/Target/AArch64/AArch64GenPreLegalizeGICombiner.inc": [
2204 "-gen-global-isel-combiner",
2205 "-combiners=AArch64PreLegalizerCombiner",
2206 ],
2207 "lib/Target/AArch64/AArch64GenPostLegalizeGICombiner.inc": [
2208 "-gen-global-isel-combiner",
2209 "-combiners=AArch64PostLegalizerCombiner",
2210 ],
2211 "lib/Target/AArch64/AArch64GenPostLegalizeGILowering.inc": [
2212 "-gen-global-isel-combiner",
2213 "-combiners=AArch64PostLegalizerLowering",
2214 ],
2215 "lib/Target/AArch64/AArch64GenCallingConv.inc": ["-gen-callingconv"],
2216 "lib/Target/AArch64/AArch64GenSDNodeInfo.inc": ["-gen-sd-node-info"],
2217 "lib/Target/AArch64/AArch64GenSubtargetInfo.inc": ["-gen-subtarget"],
2218 "lib/Target/AArch64/AArch64GenDisassemblerTables.inc": [
2219 "-gen-disassembler",
2220 ],
2221 "lib/Target/AArch64/AArch64GenSystemOperands.inc": ["-gen-searchable-tables"],
2222 "lib/Target/AArch64/AArch64GenExegesis.inc": ["-gen-exegesis"],
2223 },
2224 },
2225 {
2226 "name": "ARM",
2227 "short_name": "ARM",
2228 "tbl_outs": {
2229 "lib/Target/ARM/ARMGenRegisterBank.inc": ["-gen-register-bank"],
2230 "lib/Target/ARM/ARMGenRegisterInfo.inc": ["-gen-register-info"],
2231 "lib/Target/ARM/ARMGenSystemRegister.inc": ["-gen-searchable-tables"],
2232 "lib/Target/ARM/ARMGenInstrInfo.inc": ["-gen-instr-info"],
2233 "lib/Target/ARM/ARMGenMCCodeEmitter.inc": ["-gen-emitter"],
2234 "lib/Target/ARM/ARMGenMCPseudoLowering.inc": ["-gen-pseudo-lowering"],
2235 "lib/Target/ARM/ARMGenAsmWriter.inc": ["-gen-asm-writer"],
2236 "lib/Target/ARM/ARMGenAsmMatcher.inc": ["-gen-asm-matcher"],
2237 "lib/Target/ARM/ARMGenDAGISel.inc": ["-gen-dag-isel"],
2238 "lib/Target/ARM/ARMGenFastISel.inc": ["-gen-fast-isel"],
2239 "lib/Target/ARM/ARMGenGlobalISel.inc": ["-gen-global-isel"],
2240 "lib/Target/ARM/ARMGenCallingConv.inc": ["-gen-callingconv"],
2241 "lib/Target/ARM/ARMGenSubtargetInfo.inc": ["-gen-subtarget"],
2242 "lib/Target/ARM/ARMGenDisassemblerTables.inc": ["-gen-disassembler"],
2243 },
2244 },
2245 {
2246 "name": "AMDGPU",
2247 "short_name": "AMDGPU",
2248 "tbl_outs": {
2249 "lib/Target/AMDGPU/AMDGPUGenRegisterBank.inc": ["-gen-register-bank"],
2250 "lib/Target/AMDGPU/AMDGPUGenRegisterInfo.inc": ["-gen-register-info"],
2251 "lib/Target/AMDGPU/AMDGPUGenInstrInfo.inc": ["-gen-instr-info"],
2252 "lib/Target/AMDGPU/AMDGPUGenMCCodeEmitter.inc": ["-gen-emitter"],
2253 "lib/Target/AMDGPU/AMDGPUGenMCPseudoLowering.inc": ["-gen-pseudo-lowering"],
2254 "lib/Target/AMDGPU/AMDGPUGenAsmWriter.inc": ["-gen-asm-writer"],
2255 "lib/Target/AMDGPU/AMDGPUGenAsmMatcher.inc": ["-gen-asm-matcher"],
2256 "lib/Target/AMDGPU/AMDGPUGenDAGISel.inc": ["-gen-dag-isel"],
2257 "lib/Target/AMDGPU/AMDGPUGenCallingConv.inc": ["-gen-callingconv"],
2258 "lib/Target/AMDGPU/AMDGPUGenSubtargetInfo.inc": ["-gen-subtarget"],
2259 "lib/Target/AMDGPU/AMDGPUGenDisassemblerTables.inc": ["-gen-disassembler"],
2260 "lib/Target/AMDGPU/AMDGPUGenSearchableTables.inc": ["-gen-searchable-tables"],
2261 },
2262 "tbl_deps": [
2263 ":InstCombineTableGen",
2264 ":amdgpu_isel_target_gen",
2265 ":r600_target_gen",
2266 ],
2267 },
2268 {
2269 "name": "AVR",
2270 "short_name": "AVR",
2271 "tbl_outs": {
2272 "lib/Target/AVR/AVRGenAsmMatcher.inc": ["-gen-asm-matcher"],
2273 "lib/Target/AVR/AVRGenAsmWriter.inc": ["-gen-asm-writer"],
2274 "lib/Target/AVR/AVRGenCallingConv.inc": ["-gen-callingconv"],
2275 "lib/Target/AVR/AVRGenDAGISel.inc": ["-gen-dag-isel"],
2276 "lib/Target/AVR/AVRGenDisassemblerTables.inc": ["-gen-disassembler"],
2277 "lib/Target/AVR/AVRGenMCCodeEmitter.inc": ["-gen-emitter"],
2278 "lib/Target/AVR/AVRGenInstrInfo.inc": ["-gen-instr-info"],
2279 "lib/Target/AVR/AVRGenRegisterInfo.inc": ["-gen-register-info"],
2280 "lib/Target/AVR/AVRGenSDNodeInfo.inc": ["-gen-sd-node-info"],
2281 "lib/Target/AVR/AVRGenSubtargetInfo.inc": ["-gen-subtarget"],
2282 },
2283 },
2284 {
2285 "name": "BPF",
2286 "short_name": "BPF",
2287 "tbl_outs": {
2288 "lib/Target/BPF/BPFGenRegisterBank.inc": ["-gen-register-bank"],
2289 "lib/Target/BPF/BPFGenAsmWriter.inc": ["-gen-asm-writer"],
2290 "lib/Target/BPF/BPFGenAsmMatcher.inc": ["-gen-asm-matcher"],
2291 "lib/Target/BPF/BPFGenCallingConv.inc": ["-gen-callingconv"],
2292 "lib/Target/BPF/BPFGenDAGISel.inc": ["-gen-dag-isel"],
2293 "lib/Target/BPF/BPFGenGlobalISel.inc": ["-gen-global-isel"],
2294 "lib/Target/BPF/BPFGenDisassemblerTables.inc": ["-gen-disassembler"],
2295 "lib/Target/BPF/BPFGenMCCodeEmitter.inc": ["-gen-emitter"],
2296 "lib/Target/BPF/BPFGenInstrInfo.inc": ["-gen-instr-info"],
2297 "lib/Target/BPF/BPFGenRegisterInfo.inc": ["-gen-register-info"],
2298 "lib/Target/BPF/BPFGenSubtargetInfo.inc": ["-gen-subtarget"],
2299 },
2300 },
2301 {
2302 "name": "Hexagon",
2303 "short_name": "Hexagon",
2304 "tbl_outs": {
2305 "lib/Target/Hexagon/HexagonGenAsmMatcher.inc": ["-gen-asm-matcher"],
2306 "lib/Target/Hexagon/HexagonGenAsmWriter.inc": ["-gen-asm-writer"],
2307 "lib/Target/Hexagon/HexagonGenCallingConv.inc": ["-gen-callingconv"],
2308 "lib/Target/Hexagon/HexagonGenDAGISel.inc": ["-gen-dag-isel"],
2309 "lib/Target/Hexagon/HexagonGenDFAPacketizer.inc": ["-gen-dfa-packetizer"],
2310 "lib/Target/Hexagon/HexagonGenDisassemblerTables.inc": ["-gen-disassembler"],
2311 "lib/Target/Hexagon/HexagonGenInstrInfo.inc": ["-gen-instr-info"],
2312 "lib/Target/Hexagon/HexagonGenMCCodeEmitter.inc": ["-gen-emitter"],
2313 "lib/Target/Hexagon/HexagonGenRegisterInfo.inc": ["-gen-register-info"],
2314 "lib/Target/Hexagon/HexagonGenSubtargetInfo.inc": ["-gen-subtarget"],
2315 },
2316 },
2317 {
2318 "name": "Lanai",
2319 "short_name": "Lanai",
2320 "tbl_outs": {
2321 "lib/Target/Lanai/LanaiGenAsmMatcher.inc": ["-gen-asm-matcher"],
2322 "lib/Target/Lanai/LanaiGenAsmWriter.inc": ["-gen-asm-writer"],
2323 "lib/Target/Lanai/LanaiGenCallingConv.inc": ["-gen-callingconv"],
2324 "lib/Target/Lanai/LanaiGenDAGISel.inc": ["-gen-dag-isel"],
2325 "lib/Target/Lanai/LanaiGenDisassemblerTables.inc": ["-gen-disassembler"],
2326 "lib/Target/Lanai/LanaiGenMCCodeEmitter.inc": ["-gen-emitter"],
2327 "lib/Target/Lanai/LanaiGenInstrInfo.inc": ["-gen-instr-info"],
2328 "lib/Target/Lanai/LanaiGenRegisterInfo.inc": ["-gen-register-info"],
2329 "lib/Target/Lanai/LanaiGenSDNodeInfo.inc": ["-gen-sd-node-info"],
2330 "lib/Target/Lanai/LanaiGenSubtargetInfo.inc": ["-gen-subtarget"],
2331 },
2332 },
2333 {
2334 "name": "LoongArch",
2335 "short_name": "LoongArch",
2336 "tbl_outs": {
2337 "lib/Target/LoongArch/LoongArchGenAsmMatcher.inc": ["-gen-asm-matcher"],
2338 "lib/Target/LoongArch/LoongArchGenAsmWriter.inc": ["-gen-asm-writer"],
2339 "lib/Target/LoongArch/LoongArchGenDAGISel.inc": ["-gen-dag-isel"],
2340 "lib/Target/LoongArch/LoongArchGenDisassemblerTables.inc": ["-gen-disassembler"],
2341 "lib/Target/LoongArch/LoongArchGenMCCodeEmitter.inc": ["-gen-emitter"],
2342 "lib/Target/LoongArch/LoongArchGenInstrInfo.inc": ["-gen-instr-info"],
2343 "lib/Target/LoongArch/LoongArchGenMCPseudoLowering.inc": ["-gen-pseudo-lowering"],
2344 "lib/Target/LoongArch/LoongArchGenRegisterInfo.inc": ["-gen-register-info"],
2345 "lib/Target/LoongArch/LoongArchGenSubtargetInfo.inc": ["-gen-subtarget"],
2346 },
2347 },
2348 {
2349 "name": "Mips",
2350 "short_name": "Mips",
2351 "tbl_outs": {
2352 "lib/Target/Mips/MipsGenAsmMatcher.inc": ["-gen-asm-matcher"],
2353 "lib/Target/Mips/MipsGenAsmWriter.inc": ["-gen-asm-writer"],
2354 "lib/Target/Mips/MipsGenCallingConv.inc": ["-gen-callingconv"],
2355 "lib/Target/Mips/MipsGenDAGISel.inc": ["-gen-dag-isel"],
2356 "lib/Target/Mips/MipsGenDisassemblerTables.inc": ["-gen-disassembler"],
2357 "lib/Target/Mips/MipsGenMCCodeEmitter.inc": ["-gen-emitter"],
2358 "lib/Target/Mips/MipsGenExegesis.inc": ["-gen-exegesis"],
2359 "lib/Target/Mips/MipsGenFastISel.inc": ["-gen-fast-isel"],
2360 "lib/Target/Mips/MipsGenGlobalISel.inc": ["-gen-global-isel"],
2361 "lib/Target/Mips/MipsGenPostLegalizeGICombiner.inc": [
2362 "-gen-global-isel-combiner",
2363 "-combiners=MipsPostLegalizerCombiner",
2364 ],
2365 "lib/Target/Mips/MipsGenInstrInfo.inc": ["-gen-instr-info"],
2366 "lib/Target/Mips/MipsGenMCPseudoLowering.inc": ["-gen-pseudo-lowering"],
2367 "lib/Target/Mips/MipsGenRegisterBank.inc": ["-gen-register-bank"],
2368 "lib/Target/Mips/MipsGenRegisterInfo.inc": ["-gen-register-info"],
2369 "lib/Target/Mips/MipsGenSubtargetInfo.inc": ["-gen-subtarget"],
2370 },
2371 },
2372 {
2373 "name": "MSP430",
2374 "short_name": "MSP430",
2375 "tbl_outs": {
2376 "lib/Target/MSP430/MSP430GenAsmMatcher.inc": ["-gen-asm-matcher"],
2377 "lib/Target/MSP430/MSP430GenAsmWriter.inc": ["-gen-asm-writer"],
2378 "lib/Target/MSP430/MSP430GenCallingConv.inc": ["-gen-callingconv"],
2379 "lib/Target/MSP430/MSP430GenDAGISel.inc": ["-gen-dag-isel"],
2380 "lib/Target/MSP430/MSP430GenDisassemblerTables.inc": ["-gen-disassembler"],
2381 "lib/Target/MSP430/MSP430GenInstrInfo.inc": ["-gen-instr-info"],
2382 "lib/Target/MSP430/MSP430GenMCCodeEmitter.inc": ["-gen-emitter"],
2383 "lib/Target/MSP430/MSP430GenRegisterInfo.inc": ["-gen-register-info"],
2384 "lib/Target/MSP430/MSP430GenSDNodeInfo.inc": ["-gen-sd-node-info"],
2385 "lib/Target/MSP430/MSP430GenSubtargetInfo.inc": ["-gen-subtarget"],
2386 },
2387 },
2388 {
2389 "name": "NVPTX",
2390 "short_name": "NVPTX",
2391 "tbl_outs": {
2392 "lib/Target/NVPTX/NVPTXGenRegisterInfo.inc": ["-gen-register-info"],
2393 "lib/Target/NVPTX/NVPTXGenInstrInfo.inc": ["-gen-instr-info"],
2394 "lib/Target/NVPTX/NVPTXGenAsmWriter.inc": ["-gen-asm-writer"],
2395 "lib/Target/NVPTX/NVPTXGenDAGISel.inc": ["-gen-dag-isel"],
2396 "lib/Target/NVPTX/NVPTXGenSubtargetInfo.inc": ["-gen-subtarget"],
2397 },
2398 },
2399 {
2400 "name": "PowerPC",
2401 "short_name": "PPC",
2402 "tbl_outs": {
2403 "lib/Target/PowerPC/PPCGenAsmWriter.inc": ["-gen-asm-writer"],
2404 "lib/Target/PowerPC/PPCGenAsmMatcher.inc": ["-gen-asm-matcher"],
2405 "lib/Target/PowerPC/PPCGenMCCodeEmitter.inc": ["-gen-emitter"],
2406 "lib/Target/PowerPC/PPCGenRegisterInfo.inc": ["-gen-register-info"],
2407 "lib/Target/PowerPC/PPCGenInstrInfo.inc": ["-gen-instr-info"],
2408 "lib/Target/PowerPC/PPCGenDAGISel.inc": ["-gen-dag-isel"],
2409 "lib/Target/PowerPC/PPCGenFastISel.inc": ["-gen-fast-isel"],
2410 "lib/Target/PowerPC/PPCGenCallingConv.inc": ["-gen-callingconv"],
2411 "lib/Target/PowerPC/PPCGenSubtargetInfo.inc": ["-gen-subtarget"],
2412 "lib/Target/PowerPC/PPCGenDisassemblerTables.inc": ["-gen-disassembler"],
2413 "lib/Target/PowerPC/PPCGenRegisterBank.inc": ["-gen-register-bank"],
2414 "lib/Target/PowerPC/PPCGenGlobalISel.inc": ["-gen-global-isel"],
2415 "lib/Target/PowerPC/PPCGenExegesis.inc": ["-gen-exegesis"],
2416 },
2417 },
2418 {
2419 "name": "RISCV",
2420 "short_name": "RISCV",
2421 "tbl_outs": {
2422 "lib/Target/RISCV/RISCVGenAsmMatcher.inc": ["-gen-asm-matcher"],
2423 "lib/Target/RISCV/RISCVGenAsmWriter.inc": ["-gen-asm-writer"],
2424 "lib/Target/RISCV/RISCVGenCompressInstEmitter.inc": ["-gen-compress-inst-emitter"],
2425 "lib/Target/RISCV/RISCVGenDAGISel.inc": ["-gen-dag-isel"],
2426 "lib/Target/RISCV/RISCVGenDisassemblerTables.inc": ["-gen-disassembler"],
2427 "lib/Target/RISCV/RISCVGenInstrInfo.inc": ["-gen-instr-info"],
2428 "lib/Target/RISCV/RISCVGenMacroFusion.inc": ["-gen-macro-fusion-pred"],
2429 "lib/Target/RISCV/RISCVGenMCCodeEmitter.inc": ["-gen-emitter"],
2430 "lib/Target/RISCV/RISCVGenMCPseudoLowering.inc": ["-gen-pseudo-lowering"],
2431 "lib/Target/RISCV/RISCVGenRegisterBank.inc": ["-gen-register-bank"],
2432 "lib/Target/RISCV/RISCVGenRegisterInfo.inc": ["-gen-register-info"],
2433 "lib/Target/RISCV/RISCVGenSubtargetInfo.inc": ["-gen-subtarget"],
2434 "lib/Target/RISCV/RISCVGenSearchableTables.inc": ["-gen-searchable-tables"],
2435 "lib/Target/RISCV/RISCVGenExegesis.inc": ["-gen-exegesis"],
2436 "lib/Target/RISCV/RISCVGenSDNodeInfo.inc": ["-gen-sd-node-info"],
2437 },
2438 "tbl_deps": [
2439 ":riscv_isel_target_gen",
2440 ],
2441 },
2442 {
2443 "name": "Sparc",
2444 "short_name": "Sparc",
2445 "tbl_outs": {
2446 "lib/Target/Sparc/SparcGenAsmWriter.inc": ["-gen-asm-writer"],
2447 "lib/Target/Sparc/SparcGenAsmMatcher.inc": ["-gen-asm-matcher"],
2448 "lib/Target/Sparc/SparcGenMCCodeEmitter.inc": ["-gen-emitter"],
2449 "lib/Target/Sparc/SparcGenRegisterInfo.inc": ["-gen-register-info"],
2450 "lib/Target/Sparc/SparcGenInstrInfo.inc": ["-gen-instr-info"],
2451 "lib/Target/Sparc/SparcGenDAGISel.inc": ["-gen-dag-isel"],
2452 "lib/Target/Sparc/SparcGenCallingConv.inc": ["-gen-callingconv"],
2453 "lib/Target/Sparc/SparcGenSubtargetInfo.inc": ["-gen-subtarget"],
2454 "lib/Target/Sparc/SparcGenDisassemblerTables.inc": ["-gen-disassembler"],
2455 "lib/Target/Sparc/SparcGenSearchableTables.inc": ["-gen-searchable-tables"],
2456 "lib/Target/Sparc/SparcGenSDNodeInfo.inc": [
2457 "-gen-sd-node-info",
2458 "-sdnode-namespace=SPISD",
2459 ],
2460 },
2461 },
2462 {
2463 "name": "SPIRV",
2464 "short_name": "SPIRV",
2465 "tbl_outs": {
2466 "lib/Target/SPIRV/SPIRVGenAsmWriter.inc": ["-gen-asm-writer"],
2467 "lib/Target/SPIRV/SPIRVGenMCCodeEmitter.inc": ["-gen-emitter"],
2468 "lib/Target/SPIRV/SPIRVGenGlobalISel.inc": ["-gen-global-isel"],
2469 "lib/Target/SPIRV/SPIRVGenPreLegalizeGICombiner.inc": [
2470 "-gen-global-isel-combiner",
2471 "-combiners=SPIRVPreLegalizerCombiner",
2472 ],
2473 "lib/Target/SPIRV/SPIRVGenInstrInfo.inc": ["-gen-instr-info"],
2474 "lib/Target/SPIRV/SPIRVGenRegisterBank.inc": ["-gen-register-bank"],
2475 "lib/Target/SPIRV/SPIRVGenRegisterInfo.inc": ["-gen-register-info"],
2476 "lib/Target/SPIRV/SPIRVGenTables.inc": ["-gen-searchable-tables"],
2477 "lib/Target/SPIRV/SPIRVGenSubtargetInfo.inc": ["-gen-subtarget"],
2478 },
2479 },
2480 {
2481 "name": "SystemZ",
2482 "short_name": "SystemZ",
2483 "tbl_outs": {
2484 "lib/Target/SystemZ/SystemZGenAsmMatcher.inc": ["-gen-asm-matcher"],
2485 "lib/Target/SystemZ/SystemZGenGNUAsmWriter.inc": ["-gen-asm-writer"],
2486 "lib/Target/SystemZ/SystemZGenHLASMAsmWriter.inc": [
2487 "-gen-asm-writer",
2488 "-asmwriternum=1",
2489 ],
2490 "lib/Target/SystemZ/SystemZGenCallingConv.inc": ["-gen-callingconv"],
2491 "lib/Target/SystemZ/SystemZGenDAGISel.inc": ["-gen-dag-isel"],
2492 "lib/Target/SystemZ/SystemZGenDisassemblerTables.inc": ["-gen-disassembler"],
2493 "lib/Target/SystemZ/SystemZGenMCCodeEmitter.inc": ["-gen-emitter"],
2494 "lib/Target/SystemZ/SystemZGenInstrInfo.inc": ["-gen-instr-info"],
2495 "lib/Target/SystemZ/SystemZGenRegisterInfo.inc": ["-gen-register-info"],
2496 "lib/Target/SystemZ/SystemZGenSubtargetInfo.inc": ["-gen-subtarget"],
2497 },
2498 },
2499 {
2500 "name": "VE",
2501 "short_name": "VE",
2502 "tbl_outs": {
2503 "lib/Target/VE/VEGenAsmMatcher.inc": ["-gen-asm-matcher"],
2504 "lib/Target/VE/VEGenAsmWriter.inc": ["-gen-asm-writer"],
2505 "lib/Target/VE/VEGenCallingConv.inc": ["-gen-callingconv"],
2506 "lib/Target/VE/VEGenDAGISel.inc": ["-gen-dag-isel"],
2507 "lib/Target/VE/VEGenDisassemblerTables.inc": ["-gen-disassembler"],
2508 "lib/Target/VE/VEGenMCCodeEmitter.inc": ["-gen-emitter"],
2509 "lib/Target/VE/VEGenInstrInfo.inc": ["-gen-instr-info"],
2510 "lib/Target/VE/VEGenRegisterInfo.inc": ["-gen-register-info"],
2511 "lib/Target/VE/VEGenSubtargetInfo.inc": ["-gen-subtarget"],
2512 },
2513 },
2514 {
2515 "name": "WebAssembly",
2516 "short_name": "WebAssembly",
2517 "tbl_outs": {
2518 "lib/Target/WebAssembly/WebAssemblyGenDisassemblerTables.inc": ["-gen-disassembler"],
2519 "lib/Target/WebAssembly/WebAssemblyGenAsmWriter.inc": ["-gen-asm-writer"],
2520 "lib/Target/WebAssembly/WebAssemblyGenInstrInfo.inc": ["-gen-instr-info"],
2521 "lib/Target/WebAssembly/WebAssemblyGenDAGISel.inc": ["-gen-dag-isel"],
2522 "lib/Target/WebAssembly/WebAssemblyGenFastISel.inc": ["-gen-fast-isel"],
2523 "lib/Target/WebAssembly/WebAssemblyGenMCCodeEmitter.inc": ["-gen-emitter"],
2524 "lib/Target/WebAssembly/WebAssemblyGenRegisterInfo.inc": ["-gen-register-info"],
2525 "lib/Target/WebAssembly/WebAssemblyGenSubtargetInfo.inc": ["-gen-subtarget"],
2526 "lib/Target/WebAssembly/WebAssemblyGenAsmMatcher.inc": ["-gen-asm-matcher"],
2527 },
2528 },
2529 {
2530 "name": "X86",
2531 "short_name": "X86",
2532 "tbl_outs": {
2533 "lib/Target/X86/X86GenRegisterBank.inc": ["-gen-register-bank"],
2534 "lib/Target/X86/X86GenRegisterInfo.inc": ["-gen-register-info"],
2535 "lib/Target/X86/X86GenDisassemblerTables.inc": ["-gen-disassembler"],
2536 "lib/Target/X86/X86GenInstrInfo.inc": ["-gen-instr-info"],
2537 "lib/Target/X86/X86GenAsmWriter.inc": ["-gen-asm-writer"],
2538 "lib/Target/X86/X86GenAsmWriter1.inc": [
2539 "-gen-asm-writer",
2540 "-asmwriternum=1",
2541 ],
2542 "lib/Target/X86/X86GenAsmMatcher.inc": ["-gen-asm-matcher"],
2543 "lib/Target/X86/X86GenDAGISel.inc": ["-gen-dag-isel"],
2544 "lib/Target/X86/X86GenFastISel.inc": ["-gen-fast-isel"],
2545 "lib/Target/X86/X86GenGlobalISel.inc": ["-gen-global-isel"],
2546 "lib/Target/X86/X86GenCallingConv.inc": ["-gen-callingconv"],
2547 "lib/Target/X86/X86GenSubtargetInfo.inc": ["-gen-subtarget"],
2548 "lib/Target/X86/X86GenFoldTables.inc": [
2549 "-gen-x86-fold-tables",
2550 "-asmwriternum=1",
2551 ],
2552 "lib/Target/X86/X86GenInstrMapping.inc": ["-gen-x86-instr-mapping"],
2553 "lib/Target/X86/X86GenExegesis.inc": ["-gen-exegesis"],
2554 "lib/Target/X86/X86GenMnemonicTables.inc": [
2555 "-gen-x86-mnemonic-tables",
2556 "-asmwriternum=1",
2557 ],
2558 },
2559 },
2560 {
2561 "name": "XCore",
2562 "short_name": "XCore",
2563 "tbl_outs": {
2564 "lib/Target/XCore/XCoreGenAsmWriter.inc": ["-gen-asm-writer"],
2565 "lib/Target/XCore/XCoreGenCallingConv.inc": ["-gen-callingconv"],
2566 "lib/Target/XCore/XCoreGenDAGISel.inc": ["-gen-dag-isel"],
2567 "lib/Target/XCore/XCoreGenDisassemblerTables.inc": ["-gen-disassembler"],
2568 "lib/Target/XCore/XCoreGenInstrInfo.inc": ["-gen-instr-info"],
2569 "lib/Target/XCore/XCoreGenRegisterInfo.inc": ["-gen-register-info"],
2570 "lib/Target/XCore/XCoreGenSDNodeInfo.inc": ["-gen-sd-node-info"],
2571 "lib/Target/XCore/XCoreGenSubtargetInfo.inc": ["-gen-subtarget"],
2572 },
2573 },
2574 ] if lib["name"] in llvm_targets]
2575
2576 cc_library(
2577 name = "x86_target_layering_problem_hdrs",
2578 textual_hdrs = ["lib/Target/X86/X86InstrInfo.h"],
2579 )
2580
2581 gentbl_cc_library(
2582 name = "amdgpu_isel_target_gen",
2583 strip_include_prefix = "lib/Target/AMDGPU",
2584 tbl_outs = {
2585 "lib/Target/AMDGPU/AMDGPUGenGlobalISel.inc": ["-gen-global-isel"],
2586 "lib/Target/AMDGPU/AMDGPUGenPreLegalizeGICombiner.inc": [
2587 "-gen-global-isel-combiner",
2588 "-combiners=AMDGPUPreLegalizerCombiner",
2589 ],
2590 "lib/Target/AMDGPU/AMDGPUGenPostLegalizeGICombiner.inc": [
2591 "-gen-global-isel-combiner",
2592 "-combiners=AMDGPUPostLegalizerCombiner",
2593 ],
2594 "lib/Target/AMDGPU/AMDGPUGenRegBankGICombiner.inc": [
2595 "-gen-global-isel-combiner",
2596 "-combiners=AMDGPURegBankCombiner",
2597 ],
2598 },
2599 tblgen = ":llvm-tblgen",
2600 td_file = "lib/Target/AMDGPU/AMDGPUGISel.td",
2601 deps = [
2602 ":AMDGPUTargetTdFiles",
2603 ":CommonTargetTdFiles",
2604 ],
2605 )
2606
2607 gentbl_cc_library(
2608 name = "r600_target_gen",
2609 strip_include_prefix = "lib/Target/AMDGPU",
2610 tbl_outs = {
2611 "lib/Target/AMDGPU/R600GenAsmWriter.inc": ["-gen-asm-writer"],
2612 "lib/Target/AMDGPU/R600GenCallingConv.inc": ["-gen-callingconv"],
2613 "lib/Target/AMDGPU/R600GenDAGISel.inc": ["-gen-dag-isel"],
2614 "lib/Target/AMDGPU/R600GenDFAPacketizer.inc": ["-gen-dfa-packetizer"],
2615 "lib/Target/AMDGPU/R600GenInstrInfo.inc": ["-gen-instr-info"],
2616 "lib/Target/AMDGPU/R600GenMCCodeEmitter.inc": ["-gen-emitter"],
2617 "lib/Target/AMDGPU/R600GenRegisterInfo.inc": ["-gen-register-info"],
2618 "lib/Target/AMDGPU/R600GenSubtargetInfo.inc": ["-gen-subtarget"],
2619 },
2620 tblgen = ":llvm-tblgen",
2621 td_file = "lib/Target/AMDGPU/R600.td",
2622 deps = [
2623 ":AMDGPUTargetTdFiles",
2624 ":CommonTargetTdFiles",
2625 ],
2626 )
2627
2628 gentbl_cc_library(
2629 name = "riscv_isel_target_gen",
2630 strip_include_prefix = "lib/Target/RISCV",
2631 tbl_outs = {
2632 "lib/Target/RISCV/RISCVGenGlobalISel.inc": ["-gen-global-isel"],
2633 "lib/Target/RISCV/RISCVGenO0PreLegalizeGICombiner.inc": [
2634 "-gen-global-isel-combiner",
2635 "-combiners=RISCVO0PreLegalizerCombiner",
2636 ],
2637 "lib/Target/RISCV/RISCVGenPostLegalizeGICombiner.inc": [
2638 "-gen-global-isel-combiner",
2639 "-combiners=RISCVPostLegalizerCombiner",
2640 ],
2641 "lib/Target/RISCV/RISCVGenPreLegalizeGICombiner.inc": [
2642 "-gen-global-isel-combiner",
2643 "-combiners=RISCVPreLegalizerCombiner",
2644 ],
2645 },
2646 tblgen = ":llvm-tblgen",
2647 td_file = "lib/Target/RISCV/RISCVGISel.td",
2648 deps = [
2649 ":CommonTargetTdFiles",
2650 ":RISCVTargetTdFiles",
2651 ],
2652 )
2653
2654 [[
2655 [gentbl_cc_library(
2656 name = target["name"] + "CommonTableGen",
2657 strip_include_prefix = "lib/Target/" + target["name"],
2658 # MSVC isn't happy with long string literals, while other compilers
2659 # which support them get significant compile time improvements with
2660 # them enabled. Ideally this flag would only be enabled on Windows via
2661 # a select() on `@platforms//os:windows,`, but that would
2662 # require refactoring gentbl from a macro into a rule.
2663 # TODO(#92): Refactor gentbl to support this use
2664 tbl_outs = target["tbl_outs"],
2665 tblgen = ":llvm-tblgen",
2666 td_file = "lib/Target/" + target["name"] + "/" + target["short_name"] + ".td",
2667 td_srcs = glob(
2668 [
2669 "lib/Target/" + target["name"] + "/*.td",
2670 "lib/Target/" + target["name"] + "/GISel/*.td",
2671 ],
2672 allow_empty = True,
2673 ),
2674 deps = target.get("tbl_deps", []) + [":CommonTargetTdFiles"],
2675 )],
2676 [cc_library(
2677 name = target["name"] + "Info",
2678 srcs = ["lib/Target/" + target["name"] + "/TargetInfo/" + target["name"] + "TargetInfo.cpp"],
2679 hdrs = glob(["lib/Target/" + target["name"] + "/TargetInfo/*.h"]),
2680 copts = llvm_copts,
2681 # Workaround for https://github.com/bazelbuild/bazel/issues/3828
2682 # TODO(gcmn): Remove this when upgrading to a Bazel version containing
2683 # https://github.com/bazelbuild/bazel/commit/e3b7e17b05f1
2684 includes = ["lib/Target/" + target["name"]],
2685 strip_include_prefix = "lib/Target/" + target["name"],
2686 deps = [
2687 ":" + target["name"] + "CommonTableGen",
2688 ":MC",
2689 ":Support",
2690 ":Target",
2691 ],
2692 )],
2693 # We cannot separate the `Utils` and `MCTargetDesc` sublibraries of
2694 # a number of targets due to crisscrossing inclusion of headers.
2695 [cc_library(
2696 name = target["name"] + "UtilsAndDesc",
2697 srcs = glob(
2698 [
2699 "lib/Target/" + target["name"] + "/MCTargetDesc/*.cpp",
2700 "lib/Target/" + target["name"] + "/Utils/*.cpp",
2701
2702 # We have to include these headers here as well as in the `hdrs`
2703 # below to allow the `.cpp` files to use file-relative-inclusion to
2704 # find them, even though consumers of this library use inclusion
2705 # relative to the target with the `strip_includes_prefix` of this
2706 # library. This mixture is likely incompatible with header modules.
2707 "lib/Target/" + target["name"] + "/MCTargetDesc/*.h",
2708 "lib/Target/" + target["name"] + "/Utils/*.h",
2709 ],
2710 allow_empty = True,
2711 ),
2712 hdrs = glob(
2713 [
2714 "lib/Target/" + target["name"] + "/MCTargetDesc/*.h",
2715 "lib/Target/" + target["name"] + "/Utils/*.h",
2716
2717 # This a bit of a hack to allow us to expose common, internal
2718 # target header files to other libraries within the target via
2719 # target-relative includes. This usage of headers is inherently
2720 # non-modular as there is a mixture of target-relative inclusion
2721 # using this rule and file-relative inclusion using the repeated
2722 # listing of these headers in the `srcs` of subsequent rules.
2723 "lib/Target/" + target["name"] + "/*.h",
2724
2725 # FIXME: The entries below should be `textual_hdrs` instead of
2726 # `hdrs`, but unfortunately that doesn't work with
2727 # `strip_include_prefix`:
2728 # https://github.com/bazelbuild/bazel/issues/12424
2729 #
2730 # Once that issue is fixed and released, we can switch this to
2731 # `textual_hdrs` and remove the feature disabling the various Bazel
2732 # features (both current and under-development) that motivated the
2733 # distinction between these two.
2734 "lib/Target/" + target["name"] + "/*.def",
2735 "lib/Target/" + target["name"] + "/*.inc",
2736 "lib/Target/" + target["name"] + "/MCTargetDesc/*.def",
2737 ],
2738 allow_empty = True,
2739 ),
2740 copts = llvm_copts,
2741 features = [
2742 "-parse_headers",
2743 "-header_modules",
2744 "-layering_check",
2745 ],
2746 strip_include_prefix = "lib/Target/" + target["name"],
2747 deps = [
2748 ":BinaryFormat",
2749 ":CodeGen",
2750 ":CodeGenTypes",
2751 ":Core",
2752 ":DebugInfoCodeView",
2753 ":MC",
2754 ":MCDisassembler",
2755 ":Support",
2756 ":Target",
2757 ":config",
2758 ":" + target["name"] + "CommonTableGen",
2759 ":" + target["name"] + "Info",
2760 ] + target.get("tbl_deps", []),
2761 )],
2762 [cc_library(
2763 name = target["name"] + "CodeGen",
2764 srcs = glob(
2765 [
2766 "lib/Target/" + target["name"] + "/Analysis/*.cpp",
2767 "lib/Target/" + target["name"] + "/Analysis/*.h",
2768 "lib/Target/" + target["name"] + "/GISel/*.cpp",
2769 "lib/Target/" + target["name"] + "/GISel/*.h",
2770 "lib/Target/" + target["name"] + "/*.cpp",
2771 "lib/Target/" + target["name"] + "/*.h",
2772 ],
2773 allow_empty = True,
2774 ),
2775 hdrs = ["lib/Target/" + target["name"] + "/" + target["short_name"] + ".h"],
2776 copts = llvm_copts,
2777 features = ["-layering_check"],
2778 strip_include_prefix = "lib/Target/" + target["name"],
2779 textual_hdrs = glob(
2780 [
2781 "lib/Target/" + target["name"] + "/*.def",
2782 "lib/Target/" + target["name"] + "/*.inc",
2783 ],
2784 allow_empty = True,
2785 ),
2786 deps = [
2787 ":Analysis",
2788 ":BinaryFormat",
2789 ":CFGuard",
2790 ":CodeGen",
2791 ":CodeGenTypes",
2792 ":Core",
2793 ":IPO",
2794 ":MC",
2795 ":Passes", # TODO(chandlerc): Likely a layering violation.
2796 ":ProfileData",
2797 ":Scalar",
2798 ":Support",
2799 ":Target",
2800 ":TransformUtils",
2801 ":Vectorize",
2802 ":config",
2803 ":" + target["name"] + "CommonTableGen",
2804 ":" + target["name"] + "Info",
2805 ":" + target["name"] + "UtilsAndDesc",
2806 ] + target.get("tbl_deps", []),
2807 )],
2808 [cc_library(
2809 name = target["name"] + "AsmParser",
2810 srcs = glob(
2811 [
2812 "lib/Target/" + target["name"] + "/AsmParser/*.cpp",
2813 "lib/Target/" + target["name"] + "/AsmParser/*.h",
2814 ],
2815 allow_empty = True,
2816 ),
2817 copts = llvm_copts,
2818 deps = [
2819 ":BinaryFormat",
2820 ":CodeGenTypes",
2821 ":MC",
2822 ":MCParser",
2823 ":Support",
2824 ":Target",
2825 ":TargetParser",
2826 ":" + target["name"] + "CodeGen",
2827 ":" + target["name"] + "CommonTableGen",
2828 ":" + target["name"] + "Info",
2829 ":" + target["name"] + "UtilsAndDesc",
2830 ],
2831 )],
2832 # This target is a bit of a hack to allow us to expose internal
2833 # disassembler header files via internal target-relative include paths.
2834 # This usage of headers is inherently non-modular as there is a mixture of
2835 # target-relative inclusion using this rule and same-directory inclusion
2836 # using the repeated listing of these headers in the `srcs` below.
2837 [cc_library(
2838 name = target["name"] + "DisassemblerInternalHeaders",
2839 # FIXME: This should be `textual_hdrs` instead of `hdrs`, but
2840 # unfortunately that doesn't work with `strip_include_prefix`:
2841 # https://github.com/bazelbuild/bazel/issues/12424
2842 #
2843 # Once that issue is fixed and released, we can switch this to
2844 # `textual_hdrs` and remove the feature disabling the various Bazel
2845 # features (both current and under-development) that motivated the
2846 # distinction between these two.
2847 hdrs = glob(
2848 [
2849 "lib/Target/" + target["name"] + "/Disassembler/*.h",
2850 ],
2851 allow_empty = True,
2852 ),
2853 features = [
2854 "-parse_headers",
2855 "-header_modules",
2856 ],
2857 strip_include_prefix = "lib/Target/" + target["name"],
2858 )],
2859 [cc_library(
2860 name = target["name"] + "Disassembler",
2861 srcs = glob(
2862 [
2863 "lib/Target/" + target["name"] + "/Disassembler/*.cpp",
2864 "lib/Target/" + target["name"] + "/Disassembler/*.c",
2865 "lib/Target/" + target["name"] + "/Disassembler/*.h",
2866 ],
2867 allow_empty = True,
2868 ),
2869 copts = llvm_copts,
2870 features = ["-layering_check"],
2871 deps = [
2872 ":CodeGenTypes",
2873 ":Core",
2874 ":MC",
2875 ":MCDisassembler",
2876 ":Support",
2877 ":Target",
2878 ":" + target["name"] + "CodeGen",
2879 ":" + target["name"] + "DisassemblerInternalHeaders",
2880 ":" + target["name"] + "CommonTableGen",
2881 ":" + target["name"] + "UtilsAndDesc",
2882 ],
2883 )],
2884 [cc_library(
2885 name = target["name"] + "TargetMCA",
2886 srcs = glob(
2887 [
2888 "lib/Target/" + target["name"] + "/MCA/*.cpp",
2889 "lib/Target/" + target["name"] + "/MCA/*.c",
2890 "lib/Target/" + target["name"] + "/MCA/*.h",
2891 ],
2892 allow_empty = True,
2893 ),
2894 copts = llvm_copts,
2895 features = ["-layering_check"],
2896 deps = [
2897 ":CodeGenTypes",
2898 ":MC",
2899 ":MCA",
2900 ":MCParser",
2901 ":Support",
2902 ":" + target["name"] + "DisassemblerInternalHeaders",
2903 ":" + target["name"] + "Info",
2904 ":" + target["name"] + "UtilsAndDesc",
2905 ],
2906 )],
2907 ] for target in llvm_target_lib_list]
2908
2909 cc_library(
2910 name = "AllTargetsCodeGens",
2911 copts = llvm_copts,
2912 deps = [
2913 target["name"] + "CodeGen"
2914 for target in llvm_target_lib_list
2915 ],
2916 )
2917
2918 cc_library(
2919 name = "AllTargetsAsmParsers",
2920 copts = llvm_copts,
2921 deps = [
2922 target["name"] + "AsmParser"
2923 for target in llvm_target_lib_list
2924 ],
2925 )
2926
2927 cc_library(
2928 name = "AllTargetsDisassemblers",
2929 copts = llvm_copts,
2930 deps = [
2931 target["name"] + "Disassembler"
2932 for target in llvm_target_lib_list
2933 ],
2934 )
2935
2936 cc_library(
2937 name = "AllTargetsMCAs",
2938 copts = llvm_copts,
2939 deps = [
2940 target["name"] + "TargetMCA"
2941 for target in llvm_target_lib_list
2942 ],
2943 )
2944
2945 cc_library(
2946 name = "pass_registry_def",
2947 copts = llvm_copts,
2948 textual_hdrs = ["lib/Passes/PassRegistry.def"],
2949 )
2950
2951 cc_library(
2952 name = "Passes",
2953 srcs = glob([
2954 "lib/Passes/*.cpp",
2955 ]),
2956 hdrs = glob([
2957 "include/llvm/Passes/*.h",
2958 "include/llvm/Passes/*.def",
2959 "include/llvm/Passes/*.inc",
2960 ]) + ["include/llvm-c/Transforms/PassBuilder.h"],
2961 copts = llvm_copts,
2962 deps = [
2963 ":AggressiveInstCombine",
2964 ":Analysis",
2965 ":CFGuard",
2966 ":CodeGen",
2967 ":Core",
2968 ":Coroutines",
2969 ":HipStdPar",
2970 ":IPO",
2971 ":IRPrinter",
2972 ":InstCombine",
2973 ":Instrumentation",
2974 ":MC",
2975 ":ObjCARC",
2976 ":Scalar",
2977 ":Support",
2978 ":Target",
2979 ":TransformUtils",
2980 ":Vectorize",
2981 ":common_transforms",
2982 ":config",
2983 ":pass_registry_def",
2984 ],
2985 )
2986
2987 cc_library(
2988 name = "LTO",
2989 srcs = glob([
2990 "lib/LTO/*.cpp",
2991 ]),
2992 hdrs = glob([
2993 "include/llvm/LTO/*.h",
2994 "include/llvm/LTO/legacy/*.h",
2995 ]) + [
2996 "include/llvm-c/lto.h",
2997 ],
2998 copts = llvm_copts,
2999 deps = [
3000 ":Analysis",
3001 ":BitReader",
3002 ":BitWriter",
3003 ":CGData",
3004 ":CodeGen",
3005 ":CodeGenTypes",
3006 ":Core",
3007 ":IPO",
3008 ":IRPrinter",
3009 ":IRReader",
3010 ":Linker",
3011 ":MC",
3012 ":MCParser",
3013 ":ObjCARC",
3014 ":Object",
3015 ":Passes",
3016 ":Remarks",
3017 ":Scalar",
3018 ":Support",
3019 ":Target",
3020 ":TargetParser",
3021 ":TransformUtils",
3022 ":common_transforms",
3023 ":config",
3024 ],
3025 )
3026
3027 cc_library(
3028 name = "ExecutionEngine",
3029 srcs = glob([
3030 "lib/ExecutionEngine/*.cpp",
3031 "lib/ExecutionEngine/RuntimeDyld/*.cpp",
3032 "lib/ExecutionEngine/RuntimeDyld/*.h",
3033 "lib/ExecutionEngine/RuntimeDyld/Targets/*.cpp",
3034 "lib/ExecutionEngine/RuntimeDyld/Targets/*.h",
3035 ]),
3036 hdrs = glob(
3037 [
3038 "include/llvm/ExecutionEngine/*.h",
3039 ],
3040 exclude = [
3041 "include/llvm/ExecutionEngine/MCJIT*.h",
3042 "include/llvm/ExecutionEngine/OProfileWrapper.h",
3043 ],
3044 ) + [
3045 "include/llvm-c/ExecutionEngine.h",
3046 ],
3047 copts = llvm_copts,
3048 deps = [
3049 ":BinaryFormat",
3050 ":CodeGen",
3051 ":Core",
3052 ":DebugInfo",
3053 ":MC",
3054 ":MCDisassembler",
3055 ":Object",
3056 ":OrcShared",
3057 ":OrcTargetProcess",
3058 ":Passes",
3059 ":Support",
3060 ":Target",
3061 ":TargetParser",
3062 ":config",
3063 ],
3064 )
3065
3066 cc_library(
3067 name = "Interpreter",
3068 srcs = glob([
3069 "lib/ExecutionEngine/Interpreter/*.cpp",
3070 "lib/ExecutionEngine/Interpreter/*.h",
3071 ]),
3072 hdrs = ["include/llvm/ExecutionEngine/Interpreter.h"],
3073 copts = llvm_copts,
3074 deps = [
3075 ":CodeGen",
3076 ":Core",
3077 ":ExecutionEngine",
3078 ":Support",
3079 ":Target",
3080 ":config",
3081 ],
3082 )
3083
3084 gentbl_cc_library(
3085 name = "JITLinkTableGen",
3086 strip_include_prefix = "lib/ExecutionEngine/JITLink",
3087 tbl_outs = {"lib/ExecutionEngine/JITLink/COFFOptions.inc": ["-gen-opt-parser-defs"]},
3088 tblgen = ":llvm-tblgen",
3089 td_file = "lib/ExecutionEngine/JITLink/COFFOptions.td",
3090 deps = [":OptParserTdFiles"],
3091 )
3092
3093 cc_library(
3094 name = "JITLink",
3095 srcs = glob([
3096 "lib/ExecutionEngine/JITLink/*.cpp",
3097 "lib/ExecutionEngine/JITLink/*.h",
3098 ]),
3099 hdrs = glob([
3100 "include/llvm/ExecutionEngine/JITLink/*.h",
3101 "include/llvm/ExecutionEngine/Orc/*.h",
3102 ]),
3103 copts = llvm_copts,
3104 deps = [
3105 ":BinaryFormat",
3106 ":ExecutionEngine",
3107 ":JITLinkTableGen",
3108 ":Object",
3109 ":Option",
3110 ":OrcShared",
3111 ":OrcTargetProcess",
3112 ":Support",
3113 ":TargetParser",
3114 ":config",
3115 ],
3116 )
3117
3118 cc_library(
3119 name = "MCJIT",
3120 srcs = glob([
3121 "lib/ExecutionEngine/MCJIT/*.cpp",
3122 "lib/ExecutionEngine/MCJIT/*.h",
3123 ]),
3124 hdrs = glob(["include/llvm/ExecutionEngine/MCJIT*.h"]),
3125 copts = llvm_copts,
3126 deps = [
3127 ":CodeGen",
3128 ":Core",
3129 ":ExecutionEngine",
3130 ":MC",
3131 ":Object",
3132 ":Support",
3133 ":Target",
3134 ":config",
3135 ],
3136 )
3137
3138 cc_library(
3139 name = "OrcJIT",
3140 srcs = glob([
3141 "lib/ExecutionEngine/Orc/*.cpp",
3142 ]),
3143 hdrs = glob([
3144 "include/llvm/ExecutionEngine/Orc/*.h",
3145 ]) + [
3146 "include/llvm-c/LLJIT.h",
3147 "include/llvm-c/Orc.h",
3148 "include/llvm-c/OrcEE.h",
3149 ],
3150 copts = llvm_copts,
3151 linkopts = select({
3152 "@platforms//os:android": [],
3153 "@platforms//os:windows": [],
3154 "@platforms//os:freebsd": [],
3155 "@platforms//os:macos": [],
3156 "//conditions:default": [
3157 "-lrt",
3158 ],
3159 }),
3160 deps = [
3161 ":Analysis",
3162 ":BinaryFormat",
3163 ":BitReader",
3164 ":BitWriter",
3165 ":Core",
3166 ":DebugInfoDWARF",
3167 ":ExecutionEngine",
3168 ":JITLink",
3169 ":MC",
3170 ":MCDisassembler",
3171 ":Object",
3172 ":OrcShared",
3173 ":OrcTargetProcess",
3174 ":Passes",
3175 ":Support",
3176 ":Target",
3177 ":TargetParser",
3178 ":TransformUtils",
3179 ":WindowsDriver",
3180 ":config",
3181 ],
3182 )
3183
3184 cc_library(
3185 name = "OrcShared",
3186 srcs = glob([
3187 "lib/ExecutionEngine/Orc/Shared/*.cpp",
3188 ]),
3189 hdrs = glob([
3190 "include/llvm/ExecutionEngine/Orc/Shared/*.h",
3191 ] + [
3192 "include/llvm/ExecutionEngine/Orc/SymbolStringPool.h",
3193 ]),
3194 copts = llvm_copts,
3195 deps = [
3196 ":BinaryFormat",
3197 ":CodeGen",
3198 ":Core",
3199 ":DebugInfo",
3200 ":MC",
3201 ":MCDisassembler",
3202 ":Object",
3203 ":Passes",
3204 ":Support",
3205 ":Target",
3206 ":config",
3207 ],
3208 )
3209
3210 cc_library(
3211 name = "OrcDebugging",
3212 srcs = glob([
3213 "lib/ExecutionEngine/Orc/Debugging/*.cpp",
3214 ]),
3215 hdrs = glob([
3216 "include/llvm/ExecutionEngine/Orc/Debugging/*.h",
3217 ]) + ["include/llvm-c/LLJITUtils.h"],
3218 copts = llvm_copts,
3219 deps = [
3220 ":BinaryFormat",
3221 ":DebugInfo",
3222 ":DebugInfoDWARF",
3223 ":JITLink",
3224 ":OrcJIT",
3225 ":OrcShared",
3226 ":Support",
3227 ":TargetParser",
3228 ],
3229 )
3230
3231 cc_library(
3232 name = "OrcTargetProcess",
3233 srcs = glob([
3234 "lib/ExecutionEngine/Orc/TargetProcess/*.cpp",
3235 "lib/ExecutionEngine/Orc/TargetProcess/*.h",
3236 ]),
3237 hdrs = glob([
3238 "include/llvm/ExecutionEngine/Orc/TargetProcess/*.h",
3239 ]),
3240 copts = llvm_copts,
3241 linkopts = select({
3242 "@platforms//os:android": [],
3243 "@platforms//os:windows": [],
3244 "@platforms//os:freebsd": [],
3245 "@platforms//os:macos": [],
3246 "//conditions:default": [
3247 "-lrt",
3248 ],
3249 }),
3250 deps = [
3251 ":BinaryFormat",
3252 ":CodeGen",
3253 ":Core",
3254 ":DebugInfo",
3255 ":MC",
3256 ":MCDisassembler",
3257 ":Object",
3258 ":OrcShared",
3259 ":Passes",
3260 ":Support",
3261 ":Target",
3262 ":TargetParser",
3263 ":config",
3264 ],
3265 )
3266
3267 cc_library(
3268 name = "DWARFLinker",
3269 srcs = glob([
3270 "lib/DWARFLinker/Classic/*.cpp",
3271 ]),
3272 hdrs = glob(["include/llvm/DWARFLinker/Classic/*.h"]),
3273 copts = llvm_copts,
3274 deps = [
3275 ":BinaryFormat",
3276 ":CodeGen",
3277 ":CodeGenTypes",
3278 ":DWARFLinkerBase",
3279 ":DebugInfoDWARF",
3280 ":DebugInfoDWARFLowLevel",
3281 ":MC",
3282 ":Support",
3283 ":Target",
3284 ":TargetParser",
3285 ],
3286 )
3287
3288 cc_library(
3289 name = "DWARFLinkerBase",
3290 srcs = glob([
3291 "lib/DWARFLinker/*.cpp",
3292 ]),
3293 hdrs = glob(["include/llvm/DWARFLinker/*.h"]),
3294 copts = llvm_copts,
3295 deps = [
3296 ":BinaryFormat",
3297 ":CodeGen",
3298 ":DebugInfoDWARF",
3299 ":DebugInfoDWARFLowLevel",
3300 ":Support",
3301 ":Target",
3302 ],
3303 )
3304
3305 cc_library(
3306 name = "DWARFLinkerParallel",
3307 srcs = glob([
3308 "lib/DWARFLinker/Parallel/*.cpp",
3309 "lib/DWARFLinker/Parallel/*.h",
3310 ]),
3311 hdrs = glob(["include/llvm/DWARFLinker/Parallel/*.h"]),
3312 copts = llvm_copts,
3313 deps = [
3314 ":BinaryFormat",
3315 ":CodeGen",
3316 ":DWARFLinkerBase",
3317 ":DebugInfoDWARF",
3318 ":MC",
3319 ":Object",
3320 ":Support",
3321 ":Target",
3322 ":TargetParser",
3323 ],
3324 )
3325
3326 gentbl_cc_library(
3327 name = "DllOptionsTableGen",
3328 strip_include_prefix = "lib/ToolDrivers/llvm-dlltool",
3329 tbl_outs = {"lib/ToolDrivers/llvm-dlltool/Options.inc": ["-gen-opt-parser-defs"]},
3330 tblgen = ":llvm-tblgen",
3331 td_file = "lib/ToolDrivers/llvm-dlltool/Options.td",
3332 deps = [":OptParserTdFiles"],
3333 )
3334
3335 cc_library(
3336 name = "DlltoolDriver",
3337 srcs = glob(["lib/ToolDrivers/llvm-dlltool/*.cpp"]),
3338 hdrs = glob(["include/llvm/ToolDrivers/llvm-dlltool/*.h"]),
3339 copts = llvm_copts,
3340 deps = [
3341 ":DllOptionsTableGen",
3342 ":Object",
3343 ":Option",
3344 ":Support",
3345 ":TargetParser",
3346 ],
3347 )
3348
3349 gentbl_cc_library(
3350 name = "LibOptionsTableGen",
3351 strip_include_prefix = "lib/ToolDrivers/llvm-lib",
3352 tbl_outs = {"lib/ToolDrivers/llvm-lib/Options.inc": ["-gen-opt-parser-defs"]},
3353 tblgen = ":llvm-tblgen",
3354 td_file = "lib/ToolDrivers/llvm-lib/Options.td",
3355 deps = [":OptParserTdFiles"],
3356 )
3357
3358 cc_library(
3359 name = "LibDriver",
3360 srcs = glob(["lib/ToolDrivers/llvm-lib/*.cpp"]),
3361 hdrs = glob(["include/llvm/ToolDrivers/llvm-lib/*.h"]),
3362 copts = llvm_copts,
3363 deps = [
3364 ":BinaryFormat",
3365 ":BitReader",
3366 ":LibOptionsTableGen",
3367 ":Object",
3368 ":Option",
3369 ":Support",
3370 ],
3371 )
3372
3373 cc_library(
3374 name = "InterfaceStub",
3375 srcs = glob([
3376 "lib/InterfaceStub/*.cpp",
3377 ]),
3378 hdrs = glob([
3379 "include/llvm/InterfaceStub/*.h",
3380 ]),
3381 copts = llvm_copts,
3382 deps = [
3383 ":BinaryFormat",
3384 ":MC",
3385 ":Object",
3386 ":Support",
3387 ":TargetParser",
3388 ":config",
3389 ],
3390 )
3391
3392 cc_library(
3393 name = "WindowsDriver",
3394 srcs = glob([
3395 "lib/WindowsDriver/*.cpp",
3396 ]),
3397 hdrs = glob([
3398 "include/llvm/WindowsDriver/*.h",
3399 ]),
3400 copts = llvm_copts,
3401 deps = [
3402 ":Option",
3403 ":Support",
3404 ":TargetParser",
3405 ],
3406 )
3407
3408 cc_library(
3409 name = "WindowsManifest",
3410 srcs = glob([
3411 "lib/WindowsManifest/*.cpp",
3412 ]),
3413 hdrs = glob([
3414 "include/llvm/WindowsManifest/*.h",
3415 ]),
3416 copts = llvm_copts,
3417 deps = [
3418 ":Support",
3419 ":config",
3420 ],
3421 )
3422
3423 cc_library(
3424 name = "MCA",
3425 srcs = glob([
3426 "lib/MCA/**/*.cpp",
3427 ]),
3428 hdrs = glob([
3429 "include/llvm/MCA/**/*.h",
3430 ]),
3431 copts = llvm_copts,
3432 deps = [
3433 ":MC",
3434 ":MCDisassembler",
3435 ":Object",
3436 ":Support",
3437 ],
3438 )
3439
3440 cc_library(
3441 name = "MCAApplication",
3442 srcs = glob([
3443 "tools/llvm-mca/Views/*.cpp",
3444 ]) + [
3445 mca_source
3446 for mca_source in glob(["tools/llvm-mca/*.cpp"])
3447 if mca_source != "tools/llvm-mca/llvm-mca.cpp"
3448 ],
3449 hdrs = glob([
3450 "tools/llvm-mca/*.h",
3451 "tools/llvm-mca/Views/*.h",
3452 ]),
3453 strip_include_prefix = "tools/llvm-mca",
3454 deps = [
3455 ":MC",
3456 ":MCA",
3457 ":MCParser",
3458 ":Support",
3459 ":TargetParser",
3460 ],
3461 )
3462
3463 cc_library(
3464 name = "XRay",
3465 srcs = glob([
3466 "lib/XRay/*.cpp",
3467 ]),
3468 hdrs = glob(["include/llvm/XRay/*.h"]),
3469 copts = llvm_copts,
3470 deps = [
3471 ":Object",
3472 ":Support",
3473 ":TargetParser",
3474 ],
3475 )
3476
3477 # A flag to pick which `pfm` to use for Exegesis.
3478 # Usage: `--@llvm-project//llvm:pfm=<disable|external|system>`.
3479 # Flag documentation: https://bazel.build/extending/config
3480 string_flag(
3481 name = "pfm",
3482 build_setting_default = "external",
3483 values = [
3484 "disable", # Don't include pfm at all
3485 "external", # Build pfm from source
3486 "system", # Use system pfm (non hermetic)
3487 ],
3488 )
3489
3490 config_setting(
3491 name = "pfm_disable",
3492 flag_values = {":pfm": "disable"},
3493 )
3494
3495 config_setting(
3496 name = "pfm_external",
3497 flag_values = {":pfm": "external"},
3498 )
3499
3500 config_setting(
3501 name = "pfm_system",
3502 flag_values = {":pfm": "system"},
3503 )
3504
3505 cc_library(
3506 name = "maybe_pfm",
3507 # We want dependencies of this library to have -DHAVE_LIBPFM conditionally
3508 # defined, so we set `defines` instead of `copts`.
3509 defines = select({
3510 ":pfm_external": ["HAVE_LIBPFM=1"],
3511 ":pfm_system": ["HAVE_LIBPFM=1"],
3512 "//conditions:default": [],
3513 }),
3514 deps = select({
3515 ":pfm_external": ["@pfm//:pfm_external"],
3516 ":pfm_system": ["@pfm//:pfm_system"],
3517 "//conditions:default": [],
3518 }),
3519 )
3520
3521 cc_library(
3522 name = "Exegesis",
3523 srcs = glob(
3524 [
3525 "tools/llvm-exegesis/lib/*.cpp",
3526 # We have to include these headers here as well as in the `hdrs` below
3527 # to allow the `.cpp` files to use file-relative-inclusion to find
3528 # them, even though consumers of this library use inclusion relative to
3529 # `tools/llvm-exegesis/lib` with the `strip_includes_prefix` of this
3530 # library. This mixture appears to be incompatible with header modules.
3531 "tools/llvm-exegesis/lib/*.h",
3532 ] + [
3533 "tools/llvm-exegesis/lib/{}/*.cpp".format(t)
3534 for t in llvm_target_exegesis
3535 ] + [
3536 "tools/llvm-exegesis/lib/{}/*.h".format(t)
3537 for t in llvm_target_exegesis
3538 ],
3539 allow_empty = True,
3540 ),
3541 hdrs = glob(["tools/llvm-exegesis/lib/*.h"]),
3542 copts = llvm_copts,
3543 features = [
3544 "-header_modules",
3545 "-layering_check",
3546 ],
3547 strip_include_prefix = "tools/llvm-exegesis/lib",
3548 deps = [
3549 ":AllTargetsAsmParsers",
3550 ":AllTargetsCodeGens",
3551 ":CodeGen",
3552 ":CodeGenTypes",
3553 ":Core",
3554 ":ExecutionEngine",
3555 ":MC",
3556 ":MCA",
3557 ":MCDisassembler",
3558 ":Object",
3559 ":ObjectYAML",
3560 ":OrcJIT",
3561 ":Support",
3562 ":Target",
3563 ":config",
3564 ] + select({
3565 "@platforms//os:linux": [":maybe_pfm"],
3566 "//conditions:default": [],
3567 }),
3568 )
3569
3570 ################################################################################
3571 # LLVM toolchain and development binaries
3572
3573 gentbl_cc_library(
3574 name = "DsymutilTableGen",
3575 strip_include_prefix = "tools/dsymutil",
3576 tbl_outs = {"tools/dsymutil/Options.inc": ["-gen-opt-parser-defs"]},
3577 tblgen = ":llvm-tblgen",
3578 td_file = "tools/dsymutil/Options.td",
3579 deps = [":OptParserTdFiles"],
3580 )
3581
3582 cc_library(
3583 name = "dsymutil-lib",
3584 srcs = glob([
3585 "tools/dsymutil/*.cpp",
3586 "tools/dsymutil/*.h",
3587 ]),
3588 copts = llvm_copts,
3589 deps = [
3590 ":AllTargetsCodeGens",
3591 ":BinaryFormat",
3592 ":BitReader",
3593 ":BitstreamReader",
3594 ":CodeGen",
3595 ":CodeGenTypes",
3596 ":DWARFLinker",
3597 ":DWARFLinkerParallel",
3598 ":DebugInfo",
3599 ":DebugInfoDWARF",
3600 ":DebugInfoDWARFLowLevel",
3601 ":DsymutilTableGen",
3602 ":MC",
3603 ":Object",
3604 ":Option",
3605 ":Remarks",
3606 ":Support",
3607 ":Target",
3608 ":TargetParser",
3609 ":config",
3610 ":remark_linker",
3611 ],
3612 )
3613
3614 llvm_driver_cc_binary(
3615 name = "dsymutil",
3616 stamp = 0,
3617 deps = [":dsymutil-lib"],
3618 )
3619
3620 cc_binary(
3621 name = "llc",
3622 srcs = glob([
3623 "tools/llc/*.cpp",
3624 "tools/llc/*.h",
3625 ]),
3626 copts = llvm_copts,
3627 stamp = 0,
3628 deps = [
3629 ":AllTargetsAsmParsers",
3630 ":AllTargetsCodeGens",
3631 ":Analysis",
3632 ":AsmParser",
3633 ":BitReader",
3634 ":CodeGen",
3635 ":CodeGenTypes",
3636 ":Core",
3637 ":IRPrinter",
3638 ":IRReader",
3639 ":MC",
3640 ":Passes",
3641 ":Remarks",
3642 ":Scalar",
3643 ":Support",
3644 ":Target",
3645 ":TargetParser",
3646 ":TransformUtils",
3647 ],
3648 )
3649
3650 cc_binary(
3651 name = "lli",
3652 srcs = glob([
3653 "tools/lli/*.cpp",
3654 "tools/lli/*.h",
3655 ]),
3656 copts = llvm_copts,
3657 # ll scripts rely on symbols from dependent
3658 # libraries being resolvable.
3659 linkopts = select({
3660 "@platforms//os:windows": [],
3661 "@platforms//os:macos": [],
3662 "//conditions:default": [
3663 "-Wl,--undefined=_ZTIi",
3664 "-Wl,--export-dynamic-symbol=_ZTIi",
3665 "-Wl,--export-dynamic-symbol=__cxa_begin_catch",
3666 "-Wl,--export-dynamic-symbol=__cxa_end_catch",
3667 "-Wl,--export-dynamic-symbol=__gxx_personality_v0",
3668 "-Wl,--export-dynamic-symbol=__cxa_allocate_exception",
3669 "-Wl,--export-dynamic-symbol=__cxa_throw",
3670 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBWrapper",
3671 "-Wl,--export-dynamic-symbol=llvm_orc_registerEHFrameSectionWrapper",
3672 "-Wl,--export-dynamic-symbol=llvm_orc_deregisterEHFrameSectionWrapper",
3673 ],
3674 }),
3675 stamp = 0,
3676 deps = [
3677 ":AllTargetsAsmParsers",
3678 ":AllTargetsCodeGens",
3679 ":AsmParser",
3680 ":BitReader",
3681 ":CodeGen",
3682 ":Core",
3683 ":ExecutionEngine",
3684 ":IRPrinter",
3685 ":IRReader",
3686 ":Instrumentation",
3687 ":Interpreter",
3688 ":MCJIT",
3689 ":Object",
3690 ":OrcDebugging",
3691 ":OrcJIT",
3692 ":OrcTargetProcess",
3693 ":Support",
3694 ":TargetParser",
3695 ":config",
3696 ],
3697 )
3698
3699 cc_library(
3700 name = "llvm-ar-lib",
3701 srcs = glob(["tools/llvm-ar/*.cpp"]),
3702 copts = llvm_copts,
3703 deps = [
3704 ":AllTargetsAsmParsers",
3705 ":AllTargetsCodeGens",
3706 ":BinaryFormat",
3707 ":Core",
3708 ":DlltoolDriver",
3709 ":LibDriver",
3710 ":Object",
3711 ":Support",
3712 ":TargetParser",
3713 ],
3714 )
3715
3716 llvm_driver_cc_binary(
3717 name = "llvm-ar",
3718 stamp = 0,
3719 deps = [":llvm-ar-lib"],
3720 )
3721
3722 # We need to run llvm-ar with different basenames to make it run with
3723 # different behavior.
3724 binary_alias(
3725 name = "llvm-dlltool",
3726 binary = ":llvm-ar",
3727 )
3728
3729 binary_alias(
3730 name = "llvm-lib",
3731 binary = ":llvm-ar",
3732 )
3733
3734 binary_alias(
3735 name = "llvm-ranlib",
3736 binary = ":llvm-ar",
3737 )
3738
3739 cc_binary(
3740 name = "llvm-as",
3741 srcs = glob([
3742 "tools/llvm-as/*.cpp",
3743 ]),
3744 copts = llvm_copts,
3745 stamp = 0,
3746 deps = [
3747 ":Analysis",
3748 ":AsmParser",
3749 ":BitWriter",
3750 ":Core",
3751 ":Support",
3752 ],
3753 )
3754
3755 cc_binary(
3756 name = "llvm-bcanalyzer",
3757 srcs = glob([
3758 "tools/llvm-bcanalyzer/*.cpp",
3759 ]),
3760 copts = llvm_copts,
3761 stamp = 0,
3762 deps = [
3763 ":BitReader",
3764 ":Support",
3765 ],
3766 )
3767
3768 cc_binary(
3769 name = "llvm-cat",
3770 srcs = glob([
3771 "tools/llvm-cat/*.cpp",
3772 ]),
3773 copts = llvm_copts,
3774 stamp = 0,
3775 deps = [
3776 ":BitReader",
3777 ":BitWriter",
3778 ":Core",
3779 ":IRPrinter",
3780 ":IRReader",
3781 ":Support",
3782 ],
3783 )
3784
3785 gentbl_cc_library(
3786 name = "CGDataOptsTableGen",
3787 strip_include_prefix = "tools/llvm-cgdata",
3788 tbl_outs = {"tools/llvm-cgdata/Opts.inc": ["-gen-opt-parser-defs"]},
3789 tblgen = ":llvm-tblgen",
3790 td_file = "tools/llvm-cgdata/Opts.td",
3791 deps = [":OptParserTdFiles"],
3792 )
3793
3794 cc_library(
3795 name = "llvm-cgdata-lib",
3796 srcs = glob(["tools/llvm-cgdata/*.cpp"]),
3797 copts = llvm_copts,
3798 deps = [
3799 ":CGData",
3800 ":CGDataOptsTableGen",
3801 ":CodeGen",
3802 ":Core",
3803 ":Object",
3804 ":Option",
3805 ":Support",
3806 ],
3807 )
3808
3809 llvm_driver_cc_binary(
3810 name = "llvm-cgdata",
3811 stamp = 0,
3812 deps = [":llvm-cgdata-lib"],
3813 )
3814
3815 cc_binary(
3816 name = "llvm-cfi-verify",
3817 srcs = glob([
3818 "tools/llvm-cfi-verify/*.cpp",
3819 "tools/llvm-cfi-verify/lib/*.cpp",
3820 "tools/llvm-cfi-verify/lib/*.h",
3821 ]),
3822 copts = llvm_copts,
3823 stamp = 0,
3824 deps = [
3825 ":AllTargetsAsmParsers",
3826 ":AllTargetsCodeGens",
3827 ":AllTargetsDisassemblers",
3828 ":BinaryFormat",
3829 ":DebugInfoDWARF",
3830 ":MC",
3831 ":MCDisassembler",
3832 ":MCParser",
3833 ":Object",
3834 ":Support",
3835 ":Symbolize",
3836 ],
3837 )
3838
3839 cc_binary(
3840 name = "llvm-cov",
3841 srcs = glob([
3842 "tools/llvm-cov/*.cpp",
3843 "tools/llvm-cov/*.h",
3844 ]),
3845 copts = llvm_copts,
3846 stamp = 0,
3847 deps = [
3848 ":Coverage",
3849 ":Debuginfod",
3850 ":Instrumentation",
3851 ":Object",
3852 ":ProfileData",
3853 ":Support",
3854 ":TargetParser",
3855 ":config",
3856 ],
3857 )
3858
3859 gentbl_cc_library(
3860 name = "CvtResTableGen",
3861 strip_include_prefix = "tools/llvm-cvtres",
3862 tbl_outs = {"tools/llvm-cvtres/Opts.inc": ["-gen-opt-parser-defs"]},
3863 tblgen = ":llvm-tblgen",
3864 td_file = "tools/llvm-cvtres/Opts.td",
3865 deps = [":OptParserTdFiles"],
3866 )
3867
3868 cc_binary(
3869 name = "llvm-cvtres",
3870 srcs = glob([
3871 "tools/llvm-cvtres/*.cpp",
3872 ]),
3873 copts = llvm_copts,
3874 stamp = 0,
3875 deps = [
3876 ":BinaryFormat",
3877 ":CvtResTableGen",
3878 ":Object",
3879 ":Option",
3880 ":Support",
3881 ],
3882 )
3883
3884 cc_binary(
3885 name = "llvm-cxxdump",
3886 srcs = glob([
3887 "tools/llvm-cxxdump/*.cpp",
3888 "tools/llvm-cxxdump/*.h",
3889 ]),
3890 copts = llvm_copts,
3891 stamp = 0,
3892 deps = [
3893 ":AllTargetsCodeGens",
3894 ":BitReader",
3895 ":MC",
3896 ":Object",
3897 ":Support",
3898 ],
3899 )
3900
3901 cc_binary(
3902 name = "llvm-cxxmap",
3903 srcs = glob([
3904 "tools/llvm-cxxmap/*.cpp",
3905 ]),
3906 copts = llvm_copts,
3907 stamp = 0,
3908 deps = [
3909 ":ProfileData",
3910 ":Support",
3911 ],
3912 )
3913
3914 gentbl_cc_library(
3915 name = "CxxfiltOptsTableGen",
3916 strip_include_prefix = "tools/llvm-cxxfilt",
3917 tbl_outs = {"tools/llvm-cxxfilt/Opts.inc": ["-gen-opt-parser-defs"]},
3918 tblgen = ":llvm-tblgen",
3919 td_file = "tools/llvm-cxxfilt/Opts.td",
3920 deps = [":OptParserTdFiles"],
3921 )
3922
3923 cc_library(
3924 name = "llvm-cxxfilt-lib",
3925 srcs = glob(["tools/llvm-cxxfilt/*.cpp"]),
3926 copts = llvm_copts,
3927 deps = [
3928 ":CxxfiltOptsTableGen",
3929 ":Demangle",
3930 ":Option",
3931 ":Support",
3932 ":TargetParser",
3933 ],
3934 )
3935
3936 llvm_driver_cc_binary(
3937 name = "llvm-cxxfilt",
3938 stamp = 0,
3939 deps = [":llvm-cxxfilt-lib"],
3940 )
3941
3942 cc_binary(
3943 name = "llvm-debuginfo-analyzer",
3944 srcs = glob([
3945 "tools/llvm-debuginfo-analyzer/*.cpp",
3946 "tools/llvm-debuginfo-analyzer/*.h",
3947 ]),
3948 copts = llvm_copts,
3949 stamp = 0,
3950 deps = [
3951 ":AllTargetsCodeGens",
3952 ":AllTargetsDisassemblers",
3953 ":DebugInfoLogicalView",
3954 ":Support",
3955 ],
3956 )
3957
3958 gentbl_cc_library(
3959 name = "DebugInfodFindOptsTableGen",
3960 strip_include_prefix = "tools/llvm-debuginfod-find",
3961 tbl_outs = {"tools/llvm-debuginfod-find/Opts.inc": ["-gen-opt-parser-defs"]},
3962 tblgen = ":llvm-tblgen",
3963 td_file = "tools/llvm-debuginfod-find/Opts.td",
3964 deps = [":OptParserTdFiles"],
3965 )
3966
3967 cc_library(
3968 name = "llvm-debuginfod-find-lib",
3969 srcs = glob([
3970 "tools/llvm-debuginfod-find/*.cpp",
3971 ]),
3972 copts = llvm_copts,
3973 deps = [
3974 ":BitReader",
3975 ":Core",
3976 ":DebugInfodFindOptsTableGen",
3977 ":Debuginfod",
3978 ":Option",
3979 ":Support",
3980 ":Symbolize",
3981 ],
3982 )
3983
3984 llvm_driver_cc_binary(
3985 name = "llvm-debuginfod-find",
3986 stamp = 0,
3987 deps = [":llvm-debuginfod-find-lib"],
3988 )
3989
3990 cc_binary(
3991 name = "llvm-dis",
3992 srcs = glob([
3993 "tools/llvm-dis/*.cpp",
3994 ]),
3995 copts = llvm_copts,
3996 stamp = 0,
3997 deps = [
3998 ":Analysis",
3999 ":BitReader",
4000 ":Core",
4001 ":Support",
4002 ],
4003 )
4004
4005 cc_binary(
4006 name = "llvm-dwarfdump",
4007 srcs = glob([
4008 "tools/llvm-dwarfdump/*.cpp",
4009 "tools/llvm-dwarfdump/*.h",
4010 ]),
4011 copts = llvm_copts,
4012 stamp = 0,
4013 deps = [
4014 ":AllTargetsCodeGens",
4015 ":BinaryFormat",
4016 ":DebugInfo",
4017 ":DebugInfoDWARF",
4018 ":DebugInfoDWARFLowLevel",
4019 ":MC",
4020 ":Object",
4021 ":Support",
4022 ":TargetParser",
4023 ],
4024 )
4025
4026 gentbl_cc_library(
4027 name = "DwarfutilOptionsTableGen",
4028 strip_include_prefix = "tools/llvm-dwarfutil",
4029 tbl_outs = {"tools/llvm-dwarfutil/Options.inc": ["-gen-opt-parser-defs"]},
4030 tblgen = ":llvm-tblgen",
4031 td_file = "tools/llvm-dwarfutil/Options.td",
4032 deps = [":OptParserTdFiles"],
4033 )
4034
4035 cc_binary(
4036 name = "llvm-dwarfutil",
4037 srcs = glob([
4038 "tools/llvm-dwarfutil/*.cpp",
4039 "tools/llvm-dwarfutil/*.h",
4040 ]),
4041 copts = llvm_copts,
4042 stamp = 0,
4043 deps = [
4044 ":AllTargetsAsmParsers",
4045 ":AllTargetsCodeGens",
4046 ":CodeGenTypes",
4047 ":DWARFLinker",
4048 ":DWARFLinkerParallel",
4049 ":DebugInfoDWARF",
4050 ":DebugInfoDWARFLowLevel",
4051 ":DwarfutilOptionsTableGen",
4052 ":MC",
4053 ":ObjCopy",
4054 ":Object",
4055 ":Option",
4056 ":Support",
4057 ":Target",
4058 ":TargetParser",
4059 ],
4060 )
4061
4062 gentbl_cc_library(
4063 name = "DwpOptionsTableGen",
4064 strip_include_prefix = "tools/llvm-dwp",
4065 tbl_outs = {"tools/llvm-dwp/Opts.inc": ["-gen-opt-parser-defs"]},
4066 tblgen = ":llvm-tblgen",
4067 td_file = "tools/llvm-dwp/Opts.td",
4068 deps = [":OptParserTdFiles"],
4069 )
4070
4071 cc_library(
4072 name = "llvm-dwp-lib",
4073 srcs = glob(["tools/llvm-dwp/*.cpp"]),
4074 copts = llvm_copts,
4075 deps = [
4076 ":AllTargetsCodeGens",
4077 ":DWP",
4078 ":DwpOptionsTableGen",
4079 ":MC",
4080 ":Option",
4081 ":Support",
4082 ],
4083 )
4084
4085 llvm_driver_cc_binary(
4086 name = "llvm-dwp",
4087 stamp = 0,
4088 deps = [":llvm-dwp-lib"],
4089 )
4090
4091 cc_binary(
4092 name = "llvm-exegesis",
4093 srcs = [
4094 "tools/llvm-exegesis/llvm-exegesis.cpp",
4095 ],
4096 copts = llvm_copts,
4097 stamp = 0,
4098 deps = [
4099 ":AllTargetsAsmParsers",
4100 ":AllTargetsCodeGens",
4101 ":AllTargetsDisassemblers",
4102 ":CodeGenTypes",
4103 ":Exegesis",
4104 ":MC",
4105 ":MCParser",
4106 ":Object",
4107 ":Support",
4108 ":TargetParser",
4109 ":config",
4110 ],
4111 )
4112
4113 cc_binary(
4114 name = "llvm-extract",
4115 srcs = glob([
4116 "tools/llvm-extract/*.cpp",
4117 ]),
4118 copts = llvm_copts,
4119 stamp = 0,
4120 deps = [
4121 ":AsmParser",
4122 ":BitReader",
4123 ":BitWriter",
4124 ":Core",
4125 ":IPO",
4126 ":IRPrinter",
4127 ":IRReader",
4128 ":Passes",
4129 ":Support",
4130 ],
4131 )
4132
4133 gentbl_cc_library(
4134 name = "GSYMUtilOptionsTableGen",
4135 strip_include_prefix = "tools/llvm-gsymutil",
4136 tbl_outs = {"tools/llvm-gsymutil/Opts.inc": ["-gen-opt-parser-defs"]},
4137 tblgen = ":llvm-tblgen",
4138 td_file = "tools/llvm-gsymutil/Opts.td",
4139 deps = [":OptParserTdFiles"],
4140 )
4141
4142 cc_library(
4143 name = "llvm-gsymutil-lib",
4144 srcs = glob(["tools/llvm-gsymutil/*.cpp"]),
4145 copts = llvm_copts,
4146 deps = [
4147 ":AllTargetsCodeGens",
4148 ":DebugInfo",
4149 ":DebugInfoDWARF",
4150 ":DebugInfoGSYM",
4151 ":GSYMUtilOptionsTableGen",
4152 ":MC",
4153 ":Object",
4154 ":Option",
4155 ":Support",
4156 ":Target",
4157 ":TargetParser",
4158 ],
4159 )
4160
4161 llvm_driver_cc_binary(
4162 name = "llvm-gsymutil",
4163 stamp = 0,
4164 deps = [":llvm-gsymutil-lib"],
4165 )
4166
4167 gentbl_cc_library(
4168 name = "IfsOptionsTableGen",
4169 strip_include_prefix = "tools/llvm-ifs",
4170 tbl_outs = {"tools/llvm-ifs/Opts.inc": ["-gen-opt-parser-defs"]},
4171 tblgen = ":llvm-tblgen",
4172 td_file = "tools/llvm-ifs/Opts.td",
4173 deps = [":OptParserTdFiles"],
4174 )
4175
4176 cc_library(
4177 name = "llvm-ifs-lib",
4178 srcs = glob([
4179 "tools/llvm-ifs/*.cpp",
4180 "tools/llvm-ifs/*.h",
4181 ]),
4182 copts = llvm_copts,
4183 deps = [
4184 ":BinaryFormat",
4185 ":IfsOptionsTableGen",
4186 ":InterfaceStub",
4187 ":ObjectYAML",
4188 ":Option",
4189 ":Support",
4190 ":TargetParser",
4191 ":TextAPI",
4192 ],
4193 )
4194
4195 llvm_driver_cc_binary(
4196 name = "llvm-ifs",
4197 stamp = 0,
4198 deps = [":llvm-ifs-lib"],
4199 )
4200
4201 cc_binary(
4202 name = "llvm-jitlink",
4203 srcs = glob([
4204 "tools/llvm-jitlink/*.cpp",
4205 "tools/llvm-jitlink/*.h",
4206 ]),
4207 copts = llvm_copts,
4208 # Make symbols from the standard library dynamically resolvable.
4209 linkopts = select({
4210 "@platforms//os:windows": [],
4211 "@platforms//os:macos": [],
4212 "//conditions:default": [
4213 "-Wl,--undefined=_ZTIi",
4214 "-Wl,--export-dynamic-symbol=_ZTIi",
4215 "-Wl,--export-dynamic-symbol=__cxa_begin_catch",
4216 "-Wl,--export-dynamic-symbol=__cxa_end_catch",
4217 "-Wl,--export-dynamic-symbol=__gxx_personality_v0",
4218 "-Wl,--export-dynamic-symbol=__cxa_allocate_exception",
4219 "-Wl,--export-dynamic-symbol=__cxa_throw",
4220 "-Wl,--export-dynamic-symbol=llvm_orc_registerJITLoaderGDBWrapper",
4221 ],
4222 }),
4223 stamp = 0,
4224 deps = [
4225 ":AllTargetsAsmParsers",
4226 ":AllTargetsCodeGens",
4227 ":AllTargetsDisassemblers",
4228 ":AsmParser",
4229 ":BinaryFormat",
4230 ":BitReader",
4231 ":CodeGen",
4232 ":ExecutionEngine",
4233 ":MC",
4234 ":MCDisassembler",
4235 ":MCJIT",
4236 ":Object",
4237 ":OrcDebugging",
4238 ":OrcJIT",
4239 ":OrcShared",
4240 ":OrcTargetProcess",
4241 ":Support",
4242 ":TargetParser",
4243 ":config",
4244 ],
4245 )
4246
4247 gentbl_cc_library(
4248 name = "LibtoolDarwinOptionsTableGen",
4249 strip_include_prefix = "tools/llvm-libtool-darwin",
4250 tbl_outs = {"tools/llvm-libtool-darwin/Opts.inc": ["-gen-opt-parser-defs"]},
4251 tblgen = ":llvm-tblgen",
4252 td_file = "tools/llvm-libtool-darwin/Opts.td",
4253 deps = [":OptParserTdFiles"],
4254 )
4255
4256 cc_library(
4257 name = "llvm-libtool-darwin-lib",
4258 srcs = glob([
4259 "tools/llvm-libtool-darwin/*.cpp",
4260 "tools/llvm-libtool-darwin/*.h",
4261 ]),
4262 copts = llvm_copts,
4263 deps = [
4264 ":AllTargetsAsmParsers",
4265 ":AllTargetsCodeGens",
4266 ":BinaryFormat",
4267 ":Core",
4268 ":LibtoolDarwinOptionsTableGen",
4269 ":Object",
4270 ":Option",
4271 ":Support",
4272 ":TextAPI",
4273 ],
4274 )
4275
4276 llvm_driver_cc_binary(
4277 name = "llvm-libtool-darwin",
4278 stamp = 0,
4279 deps = [":llvm-libtool-darwin-lib"],
4280 )
4281
4282 cc_binary(
4283 name = "llvm-link",
4284 srcs = glob([
4285 "tools/llvm-link/*.cpp",
4286 ]),
4287 copts = llvm_copts,
4288 stamp = 0,
4289 deps = [
4290 ":AsmParser",
4291 ":BinaryFormat",
4292 ":BitReader",
4293 ":BitWriter",
4294 ":Core",
4295 ":IPO",
4296 ":IRPrinter",
4297 ":IRReader",
4298 ":Linker",
4299 ":Object",
4300 ":Support",
4301 ":TransformUtils",
4302 ],
4303 )
4304
4305 gentbl_cc_library(
4306 name = "LipoOptsTableGen",
4307 strip_include_prefix = "tools/llvm-lipo",
4308 tbl_outs = {"tools/llvm-lipo/LipoOpts.inc": ["-gen-opt-parser-defs"]},
4309 tblgen = ":llvm-tblgen",
4310 td_file = "tools/llvm-lipo/LipoOpts.td",
4311 deps = [":OptParserTdFiles"],
4312 )
4313
4314 cc_library(
4315 name = "llvm-lipo-lib",
4316 srcs = ["tools/llvm-lipo/llvm-lipo.cpp"],
4317 copts = llvm_copts,
4318 deps = [
4319 ":AllTargetsAsmParsers",
4320 ":BinaryFormat",
4321 ":Core",
4322 ":LipoOptsTableGen",
4323 ":Object",
4324 ":Option",
4325 ":Support",
4326 ":TargetParser",
4327 ":TextAPI",
4328 ],
4329 )
4330
4331 llvm_driver_cc_binary(
4332 name = "llvm-lipo",
4333 stamp = 0,
4334 deps = [":llvm-lipo-lib"],
4335 )
4336
4337 cc_binary(
4338 name = "llvm-lto",
4339 srcs = glob([
4340 "tools/llvm-lto/*.cpp",
4341 ]),
4342 copts = llvm_copts,
4343 stamp = 0,
4344 deps = [
4345 ":AllTargetsAsmParsers",
4346 ":AllTargetsCodeGens",
4347 ":BitReader",
4348 ":BitWriter",
4349 ":CodeGen",
4350 ":Core",
4351 ":IRPrinter",
4352 ":IRReader",
4353 ":LTO",
4354 ":Support",
4355 ":Target",
4356 ],
4357 )
4358
4359 cc_binary(
4360 name = "llvm-lto2",
4361 srcs = glob([
4362 "tools/llvm-lto2/*.cpp",
4363 ]),
4364 copts = llvm_copts,
4365 stamp = 0,
4366 deps = [
4367 ":AllTargetsAsmParsers",
4368 ":AllTargetsCodeGens",
4369 ":BitReader",
4370 ":CodeGen",
4371 ":Core",
4372 ":LTO",
4373 ":Passes",
4374 ":Remarks",
4375 ":Support",
4376 ],
4377 )
4378
4379 cc_binary(
4380 name = "llvm-mc",
4381 srcs = glob([
4382 "tools/llvm-mc/*.cpp",
4383 "tools/llvm-mc/*.h",
4384 ]),
4385 copts = llvm_copts,
4386 stamp = 0,
4387 deps = [
4388 ":AllTargetsAsmParsers",
4389 ":AllTargetsCodeGens",
4390 ":AllTargetsDisassemblers",
4391 ":DWARFCFIChecker",
4392 ":MC",
4393 ":MCDisassembler",
4394 ":MCParser",
4395 ":Object",
4396 ":Support",
4397 ":TargetParser",
4398 ],
4399 )
4400
4401 cc_binary(
4402 name = "llvm-mca",
4403 srcs = [
4404 "tools/llvm-mca/llvm-mca.cpp",
4405 ],
4406 copts = llvm_copts,
4407 stamp = 0,
4408 deps = [
4409 ":AllTargetsAsmParsers",
4410 ":AllTargetsCodeGens",
4411 ":AllTargetsDisassemblers",
4412 ":AllTargetsMCAs",
4413 ":MC",
4414 ":MCA",
4415 ":MCAApplication",
4416 ":MCParser",
4417 ":Support",
4418 ":TargetParser",
4419 ],
4420 )
4421
4422 gentbl_cc_library(
4423 name = "MlTableGen",
4424 strip_include_prefix = "tools/llvm-ml",
4425 tbl_outs = {"tools/llvm-ml/Opts.inc": ["-gen-opt-parser-defs"]},
4426 tblgen = ":llvm-tblgen",
4427 td_file = "tools/llvm-ml/Opts.td",
4428 deps = [":OptParserTdFiles"],
4429 )
4430
4431 cc_library(
4432 name = "llvm-ml-lib",
4433 srcs = glob([
4434 "tools/llvm-ml/*.cpp",
4435 "tools/llvm-ml/*.h",
4436 ]),
4437 copts = llvm_copts,
4438 deps = [
4439 ":AllTargetsAsmParsers",
4440 ":AllTargetsCodeGens",
4441 ":AllTargetsDisassemblers",
4442 ":MC",
4443 ":MCDisassembler",
4444 ":MCParser",
4445 ":MlTableGen",
4446 ":Option",
4447 ":Support",
4448 ":TargetParser",
4449 ],
4450 )
4451
4452 llvm_driver_cc_binary(
4453 name = "llvm-ml",
4454 stamp = 0,
4455 deps = [":llvm-ml-lib"],
4456 )
4457
4458 binary_alias(
4459 name = "llvm-ml64",
4460 binary = ":llvm-ml",
4461 )
4462
4463 cc_binary(
4464 name = "llvm-modextract",
4465 srcs = glob([
4466 "tools/llvm-modextract/*.cpp",
4467 ]),
4468 copts = llvm_copts,
4469 stamp = 0,
4470 deps = [
4471 ":BitReader",
4472 ":BitWriter",
4473 ":IRPrinter",
4474 ":IRReader",
4475 ":Support",
4476 ],
4477 )
4478
4479 gentbl_cc_library(
4480 name = "MtTableGen",
4481 strip_include_prefix = "tools/llvm-mt",
4482 tbl_outs = {"tools/llvm-mt/Opts.inc": ["-gen-opt-parser-defs"]},
4483 tblgen = ":llvm-tblgen",
4484 td_file = "tools/llvm-mt/Opts.td",
4485 deps = [":OptParserTdFiles"],
4486 )
4487
4488 cc_library(
4489 name = "llvm-mt-lib",
4490 srcs = glob(["tools/llvm-mt/*.cpp"]),
4491 copts = llvm_copts,
4492 deps = [
4493 ":MtTableGen",
4494 ":Option",
4495 ":Support",
4496 ":WindowsManifest",
4497 ":config",
4498 ],
4499 )
4500
4501 llvm_driver_cc_binary(
4502 name = "llvm-mt",
4503 stamp = 0,
4504 deps = [":llvm-mt-lib"],
4505 )
4506
4507 gentbl_cc_library(
4508 name = "NmOptsTableGen",
4509 strip_include_prefix = "tools/llvm-nm",
4510 tbl_outs = {"tools/llvm-nm/Opts.inc": ["-gen-opt-parser-defs"]},
4511 tblgen = ":llvm-tblgen",
4512 td_file = "tools/llvm-nm/Opts.td",
4513 deps = [":OptParserTdFiles"],
4514 )
4515
4516 cc_library(
4517 name = "llvm-nm-lib",
4518 srcs = glob(["tools/llvm-nm/*.cpp"]),
4519 copts = llvm_copts,
4520 deps = [
4521 ":AllTargetsAsmParsers",
4522 ":AllTargetsCodeGens",
4523 ":BinaryFormat",
4524 ":BitReader",
4525 ":Core",
4526 ":Demangle",
4527 ":NmOptsTableGen",
4528 ":Object",
4529 ":Option",
4530 ":Support",
4531 ":Symbolize",
4532 ":TargetParser",
4533 ],
4534 )
4535
4536 llvm_driver_cc_binary(
4537 name = "llvm-nm",
4538 stamp = 0,
4539 deps = [":llvm-nm-lib"],
4540 )
4541
4542 td_library(
4543 name = "LlvmObjcopyCommonOpts",
4544 srcs = ["tools/llvm-objcopy/CommonOpts.td"],
4545 )
4546
4547 gentbl_cc_library(
4548 name = "llvm-objcopy-opts",
4549 strip_include_prefix = "tools/llvm-objcopy",
4550 tbl_outs = {"tools/llvm-objcopy/ObjcopyOpts.inc": ["-gen-opt-parser-defs"]},
4551 tblgen = ":llvm-tblgen",
4552 td_file = "tools/llvm-objcopy/ObjcopyOpts.td",
4553 deps = [
4554 ":LlvmObjcopyCommonOpts",
4555 ":OptParserTdFiles",
4556 ],
4557 )
4558
4559 gentbl_cc_library(
4560 name = "llvm-installnametool-opts",
4561 strip_include_prefix = "tools/llvm-objcopy",
4562 tbl_outs = {"tools/llvm-objcopy/InstallNameToolOpts.inc": ["-gen-opt-parser-defs"]},
4563 tblgen = ":llvm-tblgen",
4564 td_file = "tools/llvm-objcopy/InstallNameToolOpts.td",
4565 deps = [
4566 ":LlvmObjcopyCommonOpts",
4567 ":OptParserTdFiles",
4568 ],
4569 )
4570
4571 gentbl_cc_library(
4572 name = "llvm-strip-opts",
4573 strip_include_prefix = "tools/llvm-objcopy",
4574 tbl_outs = {"tools/llvm-objcopy/StripOpts.inc": ["-gen-opt-parser-defs"]},
4575 tblgen = ":llvm-tblgen",
4576 td_file = "tools/llvm-objcopy/StripOpts.td",
4577 deps = [
4578 ":LlvmObjcopyCommonOpts",
4579 ":OptParserTdFiles",
4580 ],
4581 )
4582
4583 gentbl_cc_library(
4584 name = "llvm-bitcode-strip-opts",
4585 strip_include_prefix = "tools/llvm-objcopy",
4586 tbl_outs = {"tools/llvm-objcopy/BitcodeStripOpts.inc": ["-gen-opt-parser-defs"]},
4587 tblgen = ":llvm-tblgen",
4588 td_file = "tools/llvm-objcopy/BitcodeStripOpts.td",
4589 deps = [
4590 ":LlvmObjcopyCommonOpts",
4591 ":OptParserTdFiles",
4592 ],
4593 )
4594
4595 cc_binary(
4596 name = "llvm-stress",
4597 srcs = glob([
4598 "tools/llvm-stress/*.cpp",
4599 ]),
4600 copts = llvm_copts,
4601 stamp = 0,
4602 deps = [
4603 ":Core",
4604 ":Support",
4605 ],
4606 )
4607
4608 cc_library(
4609 name = "llvm-objcopy-lib",
4610 srcs = glob([
4611 "tools/llvm-objcopy/*.cpp",
4612 "tools/llvm-objcopy/*.h",
4613 ]),
4614 copts = llvm_copts,
4615 deps = [
4616 ":BinaryFormat",
4617 ":MC",
4618 ":ObjCopy",
4619 ":Object",
4620 ":ObjectYAML",
4621 ":Option",
4622 ":Support",
4623 ":Target",
4624 ":TargetParser",
4625 ":llvm-bitcode-strip-opts",
4626 ":llvm-installnametool-opts",
4627 ":llvm-objcopy-opts",
4628 ":llvm-strip-opts",
4629 ],
4630 )
4631
4632 llvm_driver_cc_binary(
4633 name = "llvm-objcopy",
4634 stamp = 0,
4635 deps = [":llvm-objcopy-lib"],
4636 )
4637
4638 binary_alias(
4639 name = "llvm-strip",
4640 binary = ":llvm-objcopy",
4641 )
4642
4643 binary_alias(
4644 name = "llvm-bitcode-strip",
4645 binary = ":llvm-objcopy",
4646 )
4647
4648 binary_alias(
4649 name = "llvm-install-name-tool",
4650 binary = ":llvm-objcopy",
4651 )
4652
4653 cc_library(
4654 name = "llvm-objdump-lib",
4655 srcs = glob([
4656 "tools/llvm-objdump/*.cpp",
4657 "tools/llvm-objdump/*.h",
4658 ]),
4659 copts = llvm_copts,
4660 deps = [
4661 ":AllTargetsAsmParsers",
4662 ":AllTargetsCodeGens",
4663 ":AllTargetsDisassemblers",
4664 ":BinaryFormat",
4665 ":CodeGen",
4666 ":DebugInfo",
4667 ":DebugInfoBTF",
4668 ":DebugInfoDWARF",
4669 ":DebugInfoDWARFLowLevel",
4670 ":Debuginfod",
4671 ":Demangle",
4672 ":MC",
4673 ":MCDisassembler",
4674 ":ObjdumpOptsTableGen",
4675 ":Object",
4676 ":Option",
4677 ":OtoolOptsTableGen",
4678 ":Support",
4679 ":Symbolize",
4680 ":TargetParser",
4681 ":config",
4682 ],
4683 )
4684
4685 llvm_driver_cc_binary(
4686 name = "llvm-objdump",
4687 stamp = 0,
4688 deps = [":llvm-objdump-lib"],
4689 )
4690
4691 gentbl_cc_library(
4692 name = "ObjdumpOptsTableGen",
4693 strip_include_prefix = "tools/llvm-objdump",
4694 tbl_outs = {"tools/llvm-objdump/ObjdumpOpts.inc": ["-gen-opt-parser-defs"]},
4695 tblgen = ":llvm-tblgen",
4696 td_file = "tools/llvm-objdump/ObjdumpOpts.td",
4697 deps = [":OptParserTdFiles"],
4698 )
4699
4700 binary_alias(
4701 name = "llvm-otool",
4702 binary = ":llvm-objdump",
4703 )
4704
4705 gentbl_cc_library(
4706 name = "OtoolOptsTableGen",
4707 strip_include_prefix = "tools/llvm-objdump",
4708 tbl_outs = {"tools/llvm-objdump/OtoolOpts.inc": ["-gen-opt-parser-defs"]},
4709 tblgen = ":llvm-tblgen",
4710 td_file = "tools/llvm-objdump/OtoolOpts.td",
4711 deps = [":OptParserTdFiles"],
4712 )
4713
4714 cc_binary(
4715 name = "llvm-opt-report",
4716 srcs = glob([
4717 "tools/llvm-opt-report/*.cpp",
4718 ]),
4719 copts = llvm_copts,
4720 stamp = 0,
4721 deps = [
4722 ":AllTargetsCodeGens",
4723 ":Demangle",
4724 ":Remarks",
4725 ":Support",
4726 ],
4727 )
4728
4729 cc_binary(
4730 name = "llvm-pdbutil",
4731 srcs = glob([
4732 "tools/llvm-pdbutil/*.cpp",
4733 "tools/llvm-pdbutil/*.h",
4734 ]),
4735 copts = llvm_copts,
4736 stamp = 0,
4737 deps = [
4738 ":BinaryFormat",
4739 ":DebugInfoBTF",
4740 ":DebugInfoCodeView",
4741 ":DebugInfoMSF",
4742 ":DebugInfoPDB",
4743 ":Object",
4744 ":ObjectYAML",
4745 ":Support",
4746 ":config",
4747 ],
4748 )
4749
4750 cc_library(
4751 name = "llvm-profdata-lib",
4752 srcs = glob(["tools/llvm-profdata/*.cpp"]),
4753 copts = llvm_copts,
4754 deps = [
4755 ":Core",
4756 ":Debuginfod",
4757 ":Object",
4758 ":ProfileData",
4759 ":Support",
4760 ],
4761 )
4762
4763 llvm_driver_cc_binary(
4764 name = "llvm-profdata",
4765 stamp = 0,
4766 deps = [":llvm-profdata-lib"],
4767 )
4768
4769 cc_binary(
4770 name = "llvm-profgen",
4771 srcs = glob([
4772 "tools/llvm-profgen/*.cpp",
4773 "tools/llvm-profgen/*.h",
4774 ]),
4775 copts = llvm_copts,
4776 stamp = 0,
4777 deps = [
4778 ":AllTargetsCodeGens",
4779 ":AllTargetsDisassemblers",
4780 ":Core",
4781 ":DebugInfoDWARF",
4782 ":Demangle",
4783 ":IPO",
4784 ":MC",
4785 ":MCDisassembler",
4786 ":Object",
4787 ":ProfileData",
4788 ":Support",
4789 ":Symbolize",
4790 ":TargetParser",
4791 ],
4792 )
4793
4794 gentbl_cc_library(
4795 name = "RcTableGen",
4796 strip_include_prefix = "tools/llvm-rc",
4797 tbl_outs = {"tools/llvm-rc/Opts.inc": ["-gen-opt-parser-defs"]},
4798 tblgen = ":llvm-tblgen",
4799 td_file = "tools/llvm-rc/Opts.td",
4800 deps = [":OptParserTdFiles"],
4801 )
4802
4803 gentbl_cc_library(
4804 name = "WindresTableGen",
4805 strip_include_prefix = "tools/llvm-rc",
4806 tbl_outs = {"tools/llvm-rc/WindresOpts.inc": ["-gen-opt-parser-defs"]},
4807 tblgen = ":llvm-tblgen",
4808 td_file = "tools/llvm-rc/WindresOpts.td",
4809 deps = [":OptParserTdFiles"],
4810 )
4811
4812 # Workaround inability to put `.def` files into `srcs` with a library.
4813 cc_library(
4814 name = "llvm-rc-defs-lib",
4815 textual_hdrs = glob(["tools/llvm-rc/*.def"]),
4816 )
4817
4818 cc_library(
4819 name = "llvm-rc-lib",
4820 srcs = glob([
4821 "tools/llvm-rc/*.cpp",
4822 "tools/llvm-rc/*.h",
4823 ]),
4824 copts = llvm_copts,
4825 deps = [
4826 ":Object",
4827 ":Option",
4828 ":RcTableGen",
4829 ":Support",
4830 ":TargetParser",
4831 ":WindresTableGen",
4832 ":config",
4833 ":llvm-rc-defs-lib",
4834 ],
4835 )
4836
4837 llvm_driver_cc_binary(
4838 name = "llvm-rc",
4839 stamp = 0,
4840 deps = [":llvm-rc-lib"],
4841 )
4842
4843 binary_alias(
4844 name = "llvm-windres",
4845 binary = ":llvm-rc",
4846 )
4847
4848 gentbl_cc_library(
4849 name = "ReadobjOptsTableGen",
4850 strip_include_prefix = "tools/llvm-readobj",
4851 tbl_outs = {"tools/llvm-readobj/Opts.inc": ["-gen-opt-parser-defs"]},
4852 tblgen = ":llvm-tblgen",
4853 td_file = "tools/llvm-readobj/Opts.td",
4854 deps = [":OptParserTdFiles"],
4855 )
4856
4857 cc_library(
4858 name = "llvm-readobj-lib",
4859 srcs = glob([
4860 "tools/llvm-readobj/*.cpp",
4861 "tools/llvm-readobj/*.h",
4862 ]),
4863 copts = llvm_copts,
4864 deps = [
4865 ":AllTargetsCodeGens",
4866 ":BinaryFormat",
4867 ":BitReader",
4868 ":DebugInfoCodeView",
4869 ":DebugInfoDWARF",
4870 ":Demangle",
4871 ":MC",
4872 ":Object",
4873 ":Option",
4874 ":ReadobjOptsTableGen",
4875 ":Support",
4876 ],
4877 )
4878
4879 llvm_driver_cc_binary(
4880 name = "llvm-readobj",
4881 stamp = 0,
4882 deps = [":llvm-readobj-lib"],
4883 )
4884
4885 # Create an 'llvm-readelf' named binary from the 'llvm-readobj' tool.
4886 binary_alias(
4887 name = "llvm-readelf",
4888 binary = ":llvm-readobj",
4889 )
4890
4891 # Workaround inability to put `.def` files into `srcs`.
4892 cc_library(
4893 name = "llvm-reduce-defs-lib",
4894 textual_hdrs = glob(["tools/llvm-reduce/*.def"]),
4895 )
4896
4897 cc_binary(
4898 name = "llvm-reduce",
4899 srcs = glob([
4900 "tools/llvm-reduce/**/*.cpp",
4901 "tools/llvm-reduce/**/*.h",
4902 ]),
4903 copts = llvm_copts,
4904 includes = ["tools/llvm-reduce"],
4905 stamp = 0,
4906 deps = [
4907 ":AllTargetsAsmParsers",
4908 ":AllTargetsCodeGens",
4909 ":Analysis",
4910 ":BitReader",
4911 ":BitWriter",
4912 ":CodeGen",
4913 ":CodeGenTypes",
4914 ":Core",
4915 ":IPO",
4916 ":IRReader",
4917 ":MC",
4918 ":Passes",
4919 ":Support",
4920 ":Target",
4921 ":TargetParser",
4922 ":TransformUtils",
4923 ":config",
4924 ":llvm-reduce-defs-lib",
4925 ],
4926 )
4927
4928 cc_binary(
4929 name = "llvm-rtdyld",
4930 srcs = glob([
4931 "tools/llvm-rtdyld/*.cpp",
4932 ]),
4933 copts = llvm_copts,
4934 stamp = 0,
4935 deps = [
4936 ":AllTargetsCodeGens",
4937 ":AllTargetsDisassemblers",
4938 ":DebugInfo",
4939 ":DebugInfoDWARF",
4940 ":ExecutionEngine",
4941 ":MC",
4942 ":MCDisassembler",
4943 ":Object",
4944 ":Support",
4945 ],
4946 )
4947
4948 gentbl_cc_library(
4949 name = "SizeOptsTableGen",
4950 strip_include_prefix = "tools/llvm-size",
4951 tbl_outs = {"tools/llvm-size/Opts.inc": ["-gen-opt-parser-defs"]},
4952 tblgen = ":llvm-tblgen",
4953 td_file = "tools/llvm-size/Opts.td",
4954 deps = [":OptParserTdFiles"],
4955 )
4956
4957 cc_library(
4958 name = "llvm-size-lib",
4959 srcs = glob(["tools/llvm-size/*.cpp"]),
4960 copts = llvm_copts,
4961 deps = [
4962 ":Object",
4963 ":Option",
4964 ":SizeOptsTableGen",
4965 ":Support",
4966 ],
4967 )
4968
4969 llvm_driver_cc_binary(
4970 name = "llvm-size",
4971 stamp = 0,
4972 deps = [":llvm-size-lib"],
4973 )
4974
4975 cc_binary(
4976 name = "llvm-split",
4977 srcs = glob([
4978 "tools/llvm-split/*.cpp",
4979 ]),
4980 copts = llvm_copts,
4981 stamp = 0,
4982 deps = [
4983 ":AllTargetsAsmParsers",
4984 ":AllTargetsCodeGens",
4985 ":BitWriter",
4986 ":Core",
4987 ":IRPrinter",
4988 ":IRReader",
4989 ":MC",
4990 ":Support",
4991 ":Target",
4992 ":TargetParser",
4993 ":TransformUtils",
4994 ],
4995 )
4996
4997 gentbl_cc_library(
4998 name = "StringsOptsTableGen",
4999 strip_include_prefix = "tools/llvm-strings",
5000 tbl_outs = {"tools/llvm-strings/Opts.inc": ["-gen-opt-parser-defs"]},
5001 tblgen = ":llvm-tblgen",
5002 td_file = "tools/llvm-strings/Opts.td",
5003 deps = [":OptParserTdFiles"],
5004 )
5005
5006 cc_binary(
5007 name = "llvm-strings",
5008 srcs = glob([
5009 "tools/llvm-strings/*.cpp",
5010 ]),
5011 copts = llvm_copts,
5012 stamp = 0,
5013 deps = [
5014 ":Object",
5015 ":Option",
5016 ":StringsOptsTableGen",
5017 ":Support",
5018 ],
5019 )
5020
5021 gentbl_cc_library(
5022 name = "SymbolizerOptsTableGen",
5023 strip_include_prefix = "tools/llvm-symbolizer",
5024 tbl_outs = {"tools/llvm-symbolizer/Opts.inc": ["-gen-opt-parser-defs"]},
5025 tblgen = ":llvm-tblgen",
5026 td_file = "tools/llvm-symbolizer/Opts.td",
5027 deps = [":OptParserTdFiles"],
5028 )
5029
5030 cc_library(
5031 name = "llvm-symbolizer-lib",
5032 srcs = glob(["tools/llvm-symbolizer/*.cpp"]),
5033 copts = llvm_copts,
5034 deps = [
5035 ":DebugInfoDWARF",
5036 ":DebugInfoPDB",
5037 ":Debuginfod",
5038 ":Object",
5039 ":Option",
5040 ":Support",
5041 ":Symbolize",
5042 ":SymbolizerOptsTableGen",
5043 ":config",
5044 ],
5045 )
5046
5047 llvm_driver_cc_binary(
5048 name = "llvm-symbolizer",
5049 stamp = 0,
5050 deps = [":llvm-symbolizer-lib"],
5051 )
5052
5053 binary_alias(
5054 name = "llvm-addr2line",
5055 binary = ":llvm-symbolizer",
5056 )
5057
5058 cc_binary(
5059 name = "llvm-undname",
5060 srcs = glob([
5061 "tools/llvm-undname/*.cpp",
5062 ]),
5063 copts = llvm_copts,
5064 stamp = 0,
5065 deps = [
5066 ":Demangle",
5067 ":Support",
5068 ],
5069 )
5070
5071 cc_binary(
5072 name = "llvm-xray",
5073 srcs = glob([
5074 "tools/llvm-xray/*.cpp",
5075 "tools/llvm-xray/*.h",
5076 ]),
5077 copts = llvm_copts,
5078 stamp = 0,
5079 deps = [
5080 ":DebugInfoDWARF",
5081 ":Object",
5082 ":Support",
5083 ":Symbolize",
5084 ":XRay",
5085 ],
5086 )
5087
5088 cc_library(
5089 name = "opt-driver",
5090 srcs = glob([
5091 "tools/opt/*.cpp",
5092 "tools/opt/*.h",
5093 ]),
5094 copts = llvm_copts,
5095 linkopts = select({
5096 "@platforms//os:windows": [],
5097 "@platforms//os:macos": [],
5098 "//conditions:default": ["-Wl,--export-dynamic"],
5099 }),
5100 deps = [
5101 ":AllTargetsAsmParsers",
5102 ":AllTargetsCodeGens",
5103 ":Analysis",
5104 ":AsmParser",
5105 ":BitReader",
5106 ":BitWriter",
5107 ":CodeGen",
5108 ":Core",
5109 ":IPO",
5110 ":IRPrinter",
5111 ":IRReader",
5112 ":Instrumentation",
5113 ":MC",
5114 ":Passes",
5115 ":Remarks",
5116 ":Scalar",
5117 ":Support",
5118 ":Target",
5119 ":TargetParser",
5120 ":TransformUtils",
5121 ":common_transforms",
5122 ":config",
5123 ],
5124 )
5125
5126 cc_binary(
5127 name = "opt",
5128 stamp = 0,
5129 deps = [":opt-driver"],
5130 )
5131
5132 gentbl_cc_library(
5133 name = "SancovOptsTableGen",
5134 strip_include_prefix = "tools/sancov",
5135 tbl_outs = {"tools/sancov/Opts.inc": ["-gen-opt-parser-defs"]},
5136 tblgen = ":llvm-tblgen",
5137 td_file = "tools/sancov/Opts.td",
5138 deps = [":OptParserTdFiles"],
5139 )
5140
5141 cc_library(
5142 name = "sancov-lib",
5143 srcs = glob(["tools/sancov/*.cpp"]),
5144 copts = llvm_copts,
5145 deps = [
5146 ":AllTargetsCodeGens",
5147 ":AllTargetsDisassemblers",
5148 ":DebugInfoDWARF",
5149 ":DebugInfoPDB",
5150 ":MC",
5151 ":MCDisassembler",
5152 ":Object",
5153 ":Option",
5154 ":SancovOptsTableGen",
5155 ":Support",
5156 ":Symbolize",
5157 ],
5158 )
5159
5160 llvm_driver_cc_binary(
5161 name = "sancov",
5162 stamp = 0,
5163 deps = [":sancov-lib"],
5164 )
5165
5166 cc_binary(
5167 name = "sanstats",
5168 srcs = glob([
5169 "tools/sanstats/*.cpp",
5170 ]),
5171 copts = llvm_copts,
5172 stamp = 0,
5173 deps = [
5174 ":Support",
5175 ":Symbolize",
5176 ":TransformUtils",
5177 ],
5178 )
5179
5180 cc_binary(
5181 name = "split-file",
5182 srcs = glob([
5183 "utils/split-file/*.cpp",
5184 ]),
5185 copts = llvm_copts,
5186 stamp = 0,
5187 deps = [
5188 ":Support",
5189 ],
5190 )
5191
5192 filegroup(
5193 name = "gdb-scripts",
5194 srcs = glob(["utils/gdb-scripts/*"]),
5195 )
5196
5197 ################################################################################
5198 # Begin testonly libraries
5199
5200 cc_library(
5201 name = "FuzzMutate",
5202 testonly = True,
5203 srcs = glob(["lib/FuzzMutate/*.cpp"]),
5204 hdrs = glob(["include/llvm/FuzzMutate/*.h"]),
5205 copts = llvm_copts,
5206 includes = ["include"],
5207 deps = [
5208 ":Analysis",
5209 ":BitReader",
5210 ":BitWriter",
5211 ":Core",
5212 ":Scalar",
5213 ":Support",
5214 ":TargetParser",
5215 ":TransformUtils",
5216 ],
5217 )
5218
5219 cc_library(
5220 name = "Diff",
5221 testonly = True,
5222 srcs = glob(["tools/llvm-diff/lib/*.cpp"]),
5223 hdrs = glob(["tools/llvm-diff/lib/*.h"]),
5224 deps = [
5225 ":Core",
5226 ":Support",
5227 ],
5228 )
5229
5230 py_binary(
5231 name = "lit",
5232 testonly = True,
5233 srcs = ["utils/lit/lit.py"] + glob(["utils/lit/lit/**/*.py"]),
5234 imports = ["utils/lit"],
5235 )
5236
5237 py_binary(
5238 name = "extract_ir",
5239 srcs = [
5240 "utils/mlgo-utils/extract_ir.py",
5241 "utils/mlgo-utils/mlgo/__init__.py",
5242 "utils/mlgo-utils/mlgo/corpus/extract_ir_lib.py",
5243 "utils/mlgo-utils/mlgo/corpus/flags.py",
5244 ],
5245 imports = ["utils/mlgo-utils"],
5246 )
5247
5248 py_binary(
5249 name = "combine_training_corpus",
5250 srcs = [
5251 "utils/mlgo-utils/combine_training_corpus.py",
5252 "utils/mlgo-utils/mlgo/__init__.py",
5253 "utils/mlgo-utils/mlgo/corpus/combine_training_corpus_lib.py",
5254 "utils/mlgo-utils/mlgo/corpus/flags.py",
5255 ],
5256 imports = ["utils/mlgo-utils"],
5257 )
5258
5259 py_binary(
5260 name = "make_corpus",
5261 srcs = [
5262 "utils/mlgo-utils/make_corpus.py",
5263 "utils/mlgo-utils/mlgo/__init__.py",
5264 "utils/mlgo-utils/mlgo/corpus/make_corpus_lib.py",
5265 ],
5266 imports = ["utils/mlgo-utils"],
5267 )
5268
5269 cc_library(
5270 name = "TestingADT",
5271 testonly = True,
5272 hdrs = glob([
5273 "include/llvm/Testing/ADT/*.h",
5274 ]),
5275 copts = llvm_copts,
5276 deps = [
5277 ":Support",
5278 "//third-party/unittest:gmock",
5279 ],
5280 )
5281
5282 cc_library(
5283 name = "TestingDemangle",
5284 testonly = True,
5285 copts = llvm_copts,
5286 textual_hdrs = glob(["include/llvm/Testing/Demangle/*.inc"]),
5287 )
5288
5289 cc_library(
5290 name = "TestingSupport",
5291 testonly = True,
5292 srcs = glob([
5293 "lib/Testing/Support/*.cpp",
5294 ]),
5295 hdrs = glob(["include/llvm/Testing/Support/*.h"]),
5296 copts = llvm_copts,
5297 deps = [
5298 ":Support",
5299 ":config",
5300 "//third-party/unittest:gmock",
5301 "//third-party/unittest:gtest",
5302 ],
5303 )
5304
5305 cc_library(
5306 name = "TestingAnnotations",
5307 testonly = True,
5308 srcs = ["lib/Testing/Annotations/Annotations.cpp"],
5309 hdrs = ["include/llvm/Testing/Annotations/Annotations.h"],
5310 copts = llvm_copts,
5311 deps = [":Support"],
5312 )
5313
5314 ################################################################################
5315 # Begin testonly binary utilities
5316
5317 cc_binary(
5318 name = "FileCheck",
5319 testonly = True,
5320 srcs = glob([
5321 "utils/FileCheck/*.cpp",
5322 ]),
5323 copts = llvm_copts,
5324 stamp = 0,
5325 deps = [
5326 ":FileCheckLib",
5327 ":Support",
5328 ],
5329 )
5330
5331 cc_binary(
5332 name = "bugpoint",
5333 srcs = glob([
5334 "tools/bugpoint/*.cpp",
5335 "tools/bugpoint/*.h",
5336 ]),
5337 copts = llvm_copts,
5338 stamp = 0,
5339 deps = [
5340 ":AllTargetsAsmParsers",
5341 ":AllTargetsCodeGens",
5342 ":Analysis",
5343 ":AsmParser",
5344 ":BitReader",
5345 ":BitWriter",
5346 ":CodeGen",
5347 ":Core",
5348 ":IPO",
5349 ":IRPrinter",
5350 ":IRReader",
5351 ":Linker",
5352 ":Passes",
5353 ":Scalar",
5354 ":Support",
5355 ":TargetParser",
5356 ":TransformUtils",
5357 ":common_transforms",
5358 ":config",
5359 ],
5360 )
5361
5362 cc_binary(
5363 name = "count",
5364 testonly = True,
5365 srcs = glob([
5366 "utils/count/*.c",
5367 ]),
5368 stamp = 0,
5369 deps = [":Support"],
5370 )
5371
5372 cc_binary(
5373 name = "lli-child-target",
5374 testonly = True,
5375 srcs = glob([
5376 "tools/lli/ChildTarget/*.cpp",
5377 ]),
5378 copts = llvm_copts,
5379 # The tests load code into this binary that expect to see symbols
5380 # from libstdc++ such as __cxa_begin_catch and _ZTIi. The latter
5381 # isn't even used in the main binary, so we also need to force it
5382 # to be included.
5383 linkopts = select({
5384 "@platforms//os:windows": [],
5385 "@platforms//os:macos": [],
5386 "//conditions:default": [
5387 "-rdynamic",
5388 "-u_ZTIi",
5389 ],
5390 }),
5391 stamp = 0,
5392 deps = [
5393 ":OrcJIT",
5394 ":OrcTargetProcess",
5395 ":Support",
5396 ":attributes_gen",
5397 ":config",
5398 ":intrinsic_enums_gen",
5399 ],
5400 )
5401
5402 cc_binary(
5403 name = "llvm-c-test",
5404 testonly = True,
5405 srcs = glob([
5406 "tools/llvm-c-test/*.c",
5407 "tools/llvm-c-test/*.cpp",
5408 "tools/llvm-c-test/*.h",
5409 ]),
5410 stamp = 0,
5411 deps = [
5412 ":AllTargetsAsmParsers",
5413 ":AllTargetsCodeGens",
5414 ":AllTargetsDisassemblers",
5415 ":Analysis",
5416 ":BitReader",
5417 ":BitWriter",
5418 ":Core",
5419 ":ExecutionEngine",
5420 ":IPO",
5421 ":IRReader",
5422 ":InstCombine",
5423 ":LTO",
5424 ":Linker",
5425 ":MCDisassembler",
5426 ":Object",
5427 ":OrcJIT",
5428 ":Passes",
5429 ":Remarks",
5430 ":Scalar",
5431 ":Support",
5432 ":Target",
5433 ":TransformUtils",
5434 ":Vectorize",
5435 ],
5436 )
5437
5438 cc_binary(
5439 name = "llvm-diff",
5440 testonly = True,
5441 srcs = glob([
5442 "tools/llvm-diff/*.cpp",
5443 ]),
5444 copts = llvm_copts,
5445 stamp = 0,
5446 deps = [
5447 ":Core",
5448 ":Diff",
5449 ":IRPrinter",
5450 ":IRReader",
5451 ":Support",
5452 ],
5453 )
5454
5455 cc_binary(
5456 name = "llvm-isel-fuzzer",
5457 testonly = True,
5458 srcs = glob([
5459 "tools/llvm-isel-fuzzer/*.cpp",
5460 ]),
5461 copts = llvm_copts,
5462 stamp = 0,
5463 deps = [
5464 ":AllTargetsAsmParsers",
5465 ":AllTargetsCodeGens",
5466 ":Analysis",
5467 ":BitReader",
5468 ":BitWriter",
5469 ":CodeGen",
5470 ":Core",
5471 ":FuzzMutate",
5472 ":IRPrinter",
5473 ":IRReader",
5474 ":MC",
5475 ":Support",
5476 ":Target",
5477 ],
5478 )
5479
5480 # This is really a Python script, but call it sh_binary to ignore the hyphen in
5481 # the path, which py_binary does not allow.
5482 # Also, note: llvm-locstats expects llvm-dwarfdump to be in the same directory
5483 # when executed.
5484 sh_binary(
5485 name = "llvm-locstats",
5486 testonly = True,
5487 srcs = glob([
5488 "utils/llvm-locstats/*.py",
5489 ]),
5490 # llvm-locstats is a thin wrapper around llvm-dwarfdump.
5491 data = [":llvm-dwarfdump"],
5492 )
5493
5494 sh_binary(
5495 name = "llvm-original-di-preservation",
5496 testonly = True,
5497 srcs = ["utils/llvm-original-di-preservation.py"],
5498 )
5499
5500 cc_binary(
5501 name = "not",
5502 testonly = True,
5503 srcs = glob([
5504 "utils/not/*.cpp",
5505 ]),
5506 copts = llvm_copts,
5507 stamp = 0,
5508 deps = [":Support"],
5509 )
5510
5511 cc_binary(
5512 name = "llvm-opt-fuzzer",
5513 testonly = True,
5514 srcs = glob([
5515 "tools/llvm-opt-fuzzer/*.cpp",
5516 ]),
5517 copts = llvm_copts,
5518 stamp = 0,
5519 deps = [
5520 ":AllTargetsCodeGens",
5521 ":Analysis",
5522 ":BitReader",
5523 ":BitWriter",
5524 ":CodeGen",
5525 ":Core",
5526 ":Coroutines",
5527 ":FuzzMutate",
5528 ":MC",
5529 ":Passes",
5530 ":Support",
5531 ":Target",
5532 ],
5533 )
5534
5535 gentbl_cc_library(
5536 name = "ReadTAPIOptsTableGen",
5537 strip_include_prefix = "tools/llvm-readtapi",
5538 tbl_outs = {"tools/llvm-readtapi/TapiOpts.inc": ["-gen-opt-parser-defs"]},
5539 tblgen = ":llvm-tblgen",
5540 td_file = "tools/llvm-readtapi/TapiOpts.td",
5541 deps = [":OptParserTdFiles"],
5542 )
5543
5544 cc_binary(
5545 name = "llvm-readtapi",
5546 testonly = True,
5547 srcs = glob([
5548 "tools/llvm-readtapi/*.cpp",
5549 "tools/llvm-readtapi/*.h",
5550 ]),
5551 copts = llvm_copts,
5552 stamp = 0,
5553 deps = [
5554 ":BinaryFormat",
5555 ":Object",
5556 ":Option",
5557 ":ReadTAPIOptsTableGen",
5558 ":Support",
5559 ":TextAPI",
5560 ":TextAPIBinaryReader",
5561 ],
5562 )
5563
5564 gentbl_cc_library(
5565 name = "TLICheckerOptsTableGen",
5566 strip_include_prefix = "tools/llvm-tli-checker",
5567 tbl_outs = {"tools/llvm-tli-checker/Opts.inc": ["-gen-opt-parser-defs"]},
5568 tblgen = ":llvm-tblgen",
5569 td_file = "tools/llvm-tli-checker/Opts.td",
5570 deps = [":OptParserTdFiles"],
5571 )
5572
5573 cc_binary(
5574 name = "llvm-tli-checker",
5575 testonly = True,
5576 srcs = glob([
5577 "tools/llvm-tli-checker/*.cpp",
5578 ]),
5579 copts = llvm_copts,
5580 stamp = 0,
5581 deps = [
5582 ":Analysis",
5583 ":BinaryFormat",
5584 ":BitReader",
5585 ":BitstreamReader",
5586 ":Core",
5587 ":Demangle",
5588 ":MC",
5589 ":MCParser",
5590 ":Object",
5591 ":Option",
5592 ":Remarks",
5593 ":Support",
5594 ":TLICheckerOptsTableGen",
5595 ":TargetParser",
5596 ":TextAPI",
5597 ":config",
5598 ],
5599 )
5600
5601 cc_binary(
5602 name = "obj2yaml",
5603 testonly = True,
5604 srcs = glob([
5605 "tools/obj2yaml/*.cpp",
5606 "tools/obj2yaml/*.h",
5607 ]),
5608 copts = llvm_copts,
5609 stamp = 0,
5610 deps = [
5611 ":BinaryFormat",
5612 ":DebugInfoCodeView",
5613 ":DebugInfoDWARF",
5614 ":Object",
5615 ":ObjectYAML",
5616 ":Support",
5617 ],
5618 )
5619
5620 cc_binary(
5621 name = "verify-uselistorder",
5622 srcs = glob([
5623 "tools/verify-uselistorder/*.cpp",
5624 ]),
5625 copts = llvm_copts,
5626 stamp = 0,
5627 deps = [
5628 ":AsmParser",
5629 ":BitReader",
5630 ":BitWriter",
5631 ":Core",
5632 ":IRPrinter",
5633 ":IRReader",
5634 ":Support",
5635 ],
5636 )
5637
5638 cc_binary(
5639 name = "yaml2obj",
5640 testonly = True,
5641 srcs = glob([
5642 "tools/yaml2obj/*.cpp",
5643 ]),
5644 copts = llvm_copts,
5645 stamp = 0,
5646 deps = [
5647 ":BinaryFormat",
5648 ":DebugInfoCodeView",
5649 ":MC",
5650 ":Object",
5651 ":ObjectYAML",
5652 ":Support",
5653 ],
5654 )
5655
5656 cc_binary(
5657 name = "yaml-bench",
5658 testonly = True,
5659 srcs = glob([
5660 "utils/yaml-bench/*.cpp",
5661 ]),
5662 copts = llvm_copts,
5663 stamp = 0,
5664 deps = [
5665 ":Support",
5666 ],
5667 )