Skip to content

Commit 3065cf2

Browse files
authored
[bazel] Remove //clang:basic_internal_headers target (NFC) (#123230)
This target exists to allow `#include "Header.h"` for headers in lib/Basic rather than using file-relative inclusion. This is rather hacky and results in having two targets that claim the same headers. Instead, we can pass a `-I` flag in the `copts` for //clang:basic, to adjust the include path to keep those `#include "Header.h"` directives working. There are other targets in this file already doing a similar thing for generated files.
1 parent ee1c852 commit 3065cf2

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -666,19 +666,6 @@ py_binary(
666666
main = "utils/bundle_resources.py",
667667
)
668668

669-
# A hacky library to expose some internal headers of the `basic` library to its
670-
# own implementation source files using a stripped include prefix rather than
671-
# file-relative-inclusion. This is inherently non-modular as these headers will
672-
# be repeated in the sources below for file-relative-inclusion.
673-
cc_library(
674-
name = "basic_internal_headers",
675-
hdrs = glob([
676-
"lib/Basic/*.h",
677-
]),
678-
features = ["-header_modules"],
679-
strip_include_prefix = "lib/Basic",
680-
)
681-
682669
cc_library(
683670
name = "basic",
684671
srcs = [
@@ -696,6 +683,7 @@ cc_library(
696683
copts = [
697684
"-DHAVE_VCS_VERSION_INC",
698685
"$(STACK_FRAME_UNLIMITED)",
686+
"-I$(WORKSPACE_ROOT)/clang/lib/Basic",
699687
],
700688
includes = ["include"],
701689
textual_hdrs = [
@@ -731,6 +719,7 @@ cc_library(
731719
] + glob([
732720
"include/clang/Basic/*.def",
733721
]),
722+
toolchains = [":workspace_root"],
734723
deps = [
735724
":basic_arm_cde_gen",
736725
":basic_arm_fp16_inc_gen",
@@ -750,7 +739,6 @@ cc_library(
750739
":basic_builtins_spirv_gen",
751740
":basic_builtins_x86_64_gen",
752741
":basic_builtins_x86_gen",
753-
":basic_internal_headers",
754742
":basic_riscv_sifive_vector_builtins_gen",
755743
":basic_riscv_vector_builtin_cg_gen",
756744
":basic_riscv_vector_builtins_gen",

0 commit comments

Comments
 (0)