summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2024-02-01 10:56:22 +0100
committerBenjamin Kramer <benny.kra@googlemail.com>2024-02-01 10:56:22 +0100
commit395c8175e37248c11ddbffe47294033834b0ec51 (patch)
treeac2d976591756517917b9131df76cd9602923450
parent468b23935a56d2be75c1f86fea97e5620b230a93 (diff)
[bazel] Put back the pieces of TableGenGlobalISel that unittests depend on
This is a mess and needs to be cleaned up some day.
-rw-r--r--utils/bazel/llvm-project-overlay/llvm/BUILD.bazel55
1 files changed, 42 insertions, 13 deletions
diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
index 326159cf3475..f720c1856a29 100644
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -624,31 +624,60 @@ cc_binary(
)
cc_library(
+ name = "TableGenGlobalISel",
+ srcs = [
+ "utils/TableGen/GlobalISel/CodeExpander.cpp",
+ ],
+ hdrs = glob([
+ # We have to include these headers here as well as in the `hdrs` below
+ # to allow the `.cpp` files to use file-relative-inclusion to find
+ # them, even though consumers of this library use inclusion relative to
+ # `utils/TableGen` with the `strip_includes_prefix` of this library.
+ # This mixture appears to be incompatible with header modules.
+ "utils/TableGen/GlobalISel/CodeExpander.h",
+ "utils/TableGen/GlobalISel/CodeExpansions.h",
+ ]),
+ copts = llvm_copts,
+ features = ["-header_modules"],
+ strip_include_prefix = "utils/TableGen",
+ deps = [
+ ":CodeGenTypes",
+ ":Support",
+ ":TableGen",
+ ":config",
+ ],
+)
+
+cc_library(
name = "llvm-tblgen-headers",
textual_hdrs = glob(["utils/TableGen/*.def"]),
)
cc_binary(
name = "llvm-tblgen",
- srcs = glob([
- "utils/TableGen/*.cpp",
- "utils/TableGen/*.inc",
- "utils/TableGen/*.h",
- "utils/TableGen/GlobalISel/*.cpp",
- "utils/TableGen/GlobalISel/*.h",
-
- # Some tablegen sources include headers from MC, so these have to be
- # listed here. MC uses headers produced by tablegen, so it cannot be a
- # regular dependency.
- "include/llvm/MC/*.h",
- "include/llvm/TargetParser/SubtargetFeature.h",
- ]),
+ srcs = glob(
+ [
+ "utils/TableGen/*.cpp",
+ "utils/TableGen/*.inc",
+ "utils/TableGen/*.h",
+ "utils/TableGen/GlobalISel/*.cpp",
+ "utils/TableGen/GlobalISel/*.h",
+
+ # Some tablegen sources include headers from MC, so these have to be
+ # listed here. MC uses headers produced by tablegen, so it cannot be a
+ # regular dependency.
+ "include/llvm/MC/*.h",
+ "include/llvm/TargetParser/SubtargetFeature.h",
+ ],
+ exclude = ["utils/TableGen/GlobalISel/CodeExpander.cpp"],
+ ),
copts = llvm_copts,
stamp = 0,
deps = [
":CodeGenTypes",
":Support",
":TableGen",
+ ":TableGenGlobalISel",
":TargetParser",
":config",
":llvm-tblgen-headers",