Skip to content

Commit 8b0fc9d

Browse files
[libc][bazel] unglob libc macros
In a previous patch an "internal_includes" target was created to give access to the macro headers. This patch removes that in favor of individual targets for these headers, better matching the existing code.
1 parent 8b8e1ad commit 8b0fc9d

File tree

4 files changed

+36
-39
lines changed

4 files changed

+36
-39
lines changed

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

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,35 @@ config_setting(
6565
################################# Include Files ################################
6666

6767
libc_support_library(
68-
name = "internal_includes",
69-
hdrs = glob([
70-
"include/llvm-libc-macros/*.h",
71-
"include/llvm-libc-types/*",
72-
]),
68+
name = "llvm_libc_macros_math_macros",
69+
hdrs = ["include/llvm-libc-macros/math-macros.h"],
70+
)
71+
72+
libc_support_library(
73+
name = "llvm_libc_macros_limits_macros",
74+
hdrs = ["include/llvm-libc-macros/limits-macros.h"],
75+
)
76+
77+
libc_support_library(
78+
name = "llvm_libc_macros_float_macros",
79+
hdrs = ["include/llvm-libc-macros/float-macros.h"],
80+
)
81+
82+
libc_support_library(
83+
name = "llvm_libc_macros_stdint_macros",
84+
hdrs = ["include/llvm-libc-macros/stdint-macros.h"],
85+
)
86+
87+
libc_support_library(
88+
name = "llvm_libc_macros_stdfix_macros",
89+
hdrs = ["include/llvm-libc-macros/stdfix-macros.h"],
90+
deps = [":llvm_libc_macros_float_macros"],
91+
)
92+
93+
libc_support_library(
94+
name = "llvm_libc_types_float128",
95+
hdrs = ["include/llvm-libc-types/float128.h"],
96+
deps = [":llvm_libc_macros_float_macros"],
7397
)
7498

7599
############################### Support libraries ##############################
@@ -681,7 +705,7 @@ libc_support_library(
681705
":__support_macros_properties_architectures",
682706
":__support_macros_sanitizer",
683707
":errno",
684-
":internal_includes",
708+
":llvm_libc_macros_math_macros",
685709
],
686710
)
687711

@@ -754,7 +778,7 @@ libc_support_library(
754778
":__support_fputil_normal_float",
755779
":__support_macros_optimization",
756780
":__support_uint128",
757-
":internal_includes",
781+
":llvm_libc_macros_math_macros",
758782
],
759783
)
760784

@@ -768,7 +792,7 @@ libc_support_library(
768792
":__support_fputil_fp_bits",
769793
":__support_fputil_rounding_mode",
770794
":__support_macros_attributes",
771-
":internal_includes",
795+
":llvm_libc_macros_math_macros",
772796
],
773797
)
774798

@@ -997,33 +1021,6 @@ libc_support_library(
9971021
],
9981022
)
9991023

1000-
libc_support_library(
1001-
name = "llvm_libc_macros_limits_macros",
1002-
hdrs = ["include/llvm-libc-macros/limits-macros.h"],
1003-
)
1004-
1005-
libc_support_library(
1006-
name = "llvm_libc_macros_float_macros",
1007-
hdrs = ["include/llvm-libc-macros/float-macros.h"],
1008-
)
1009-
1010-
libc_support_library(
1011-
name = "llvm_libc_macros_stdint_macros",
1012-
hdrs = ["include/llvm-libc-macros/stdint-macros.h"],
1013-
)
1014-
1015-
libc_support_library(
1016-
name = "llvm_libc_macros_stdfix_macros",
1017-
hdrs = ["include/llvm-libc-macros/stdfix-macros.h"],
1018-
deps = [":llvm_libc_macros_float_macros"],
1019-
)
1020-
1021-
libc_support_library(
1022-
name = "llvm_libc_types_float128",
1023-
hdrs = ["include/llvm-libc-types/float128.h"],
1024-
deps = [":llvm_libc_macros_float_macros"],
1025-
)
1026-
10271024
############################### errno targets ################################
10281025

10291026
libc_function(
@@ -1190,7 +1187,7 @@ libc_support_library(
11901187
"__support_cpp_type_traits",
11911188
":__support_common",
11921189
":errno",
1193-
":internal_includes",
1190+
":llvm_libc_macros_math_macros",
11941191
],
11951192
)
11961193

utils/bazel/llvm-project-overlay/libc/test/src/__support/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ libc_test(
8989
"//libc:__support_cpp_optional",
9090
"//libc:__support_macros_properties_types",
9191
"//libc:__support_uint",
92-
"//libc:internal_includes",
92+
"//libc:llvm_libc_macros_math_macros",
9393
],
9494
)
9595

utils/bazel/llvm-project-overlay/libc/test/src/math/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ libc_support_library(
296296
"//libc:__support_cpp_limits",
297297
"//libc:__support_fputil_fp_bits",
298298
"//libc:__support_fputil_manipulation_functions",
299-
"//libc:internal_includes",
299+
"//libc:llvm_libc_macros_math_macros",
300300
"//libc/test/UnitTest:LibcUnitTest",
301301
],
302302
)

utils/bazel/llvm-project-overlay/libc/test/src/math/libc_math_test_rules.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def math_test(name, hdrs = [], deps = [], **kwargs):
3434
"//libc:__support_math_extras",
3535
"//libc:__support_uint128",
3636
"//libc/test/UnitTest:fp_test_helpers",
37-
"//libc:internal_includes",
37+
"//libc:llvm_libc_macros_math_macros",
3838
] + deps,
3939
**kwargs
4040
)

0 commit comments

Comments
 (0)