Skip to content

Commit 1678785

Browse files
[libc][bazel] unglob libc macros (#85831)
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 73302d3 commit 1678785

File tree

5 files changed

+43
-46
lines changed

5 files changed

+43
-46
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-
textual_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 ##############################
@@ -691,7 +715,7 @@ libc_support_library(
691715
":__support_macros_properties_architectures",
692716
":__support_macros_sanitizer",
693717
":errno",
694-
":internal_includes",
718+
":llvm_libc_macros_math_macros",
695719
],
696720
)
697721

@@ -764,7 +788,7 @@ libc_support_library(
764788
":__support_fputil_normal_float",
765789
":__support_macros_optimization",
766790
":__support_uint128",
767-
":internal_includes",
791+
":llvm_libc_macros_math_macros",
768792
],
769793
)
770794

@@ -778,7 +802,7 @@ libc_support_library(
778802
":__support_fputil_fp_bits",
779803
":__support_fputil_rounding_mode",
780804
":__support_macros_attributes",
781-
":internal_includes",
805+
":llvm_libc_macros_math_macros",
782806
],
783807
)
784808

@@ -1007,33 +1031,6 @@ libc_support_library(
10071031
],
10081032
)
10091033

1010-
libc_support_library(
1011-
name = "llvm_libc_macros_limits_macros",
1012-
hdrs = ["include/llvm-libc-macros/limits-macros.h"],
1013-
)
1014-
1015-
libc_support_library(
1016-
name = "llvm_libc_macros_float_macros",
1017-
hdrs = ["include/llvm-libc-macros/float-macros.h"],
1018-
)
1019-
1020-
libc_support_library(
1021-
name = "llvm_libc_macros_stdint_macros",
1022-
hdrs = ["include/llvm-libc-macros/stdint-macros.h"],
1023-
)
1024-
1025-
libc_support_library(
1026-
name = "llvm_libc_macros_stdfix_macros",
1027-
hdrs = ["include/llvm-libc-macros/stdfix-macros.h"],
1028-
deps = [":llvm_libc_macros_float_macros"],
1029-
)
1030-
1031-
libc_support_library(
1032-
name = "llvm_libc_types_float128",
1033-
hdrs = ["include/llvm-libc-types/float128.h"],
1034-
deps = [":llvm_libc_macros_float_macros"],
1035-
)
1036-
10371034
############################### errno targets ################################
10381035

10391036
libc_function(
@@ -1200,7 +1197,7 @@ libc_support_library(
12001197
"__support_cpp_type_traits",
12011198
":__support_common",
12021199
":errno",
1203-
":internal_includes",
1200+
":llvm_libc_macros_math_macros",
12041201
],
12051202
)
12061203

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ libc_support_library(
8484
"//libc:__support_fputil_fp_bits",
8585
"//libc:__support_fputil_fpbits_str",
8686
"//libc:__support_fputil_rounding_mode",
87-
"//libc:internal_includes",
87+
"//libc:llvm_libc_macros_math_macros",
8888
],
8989
)
9090

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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ libc_support_library(
178178
deps = [
179179
"//libc:__support_fputil_basic_operations",
180180
"//libc:__support_fputil_fp_bits",
181-
"//libc:internal_includes",
181+
"//libc:llvm_libc_macros_math_macros",
182182
"//libc/test/UnitTest:LibcUnitTest",
183183
"//libc/test/UnitTest:fp_test_helpers",
184184
"//libc/utils/MPFRWrapper:mpfr_wrapper",
@@ -297,7 +297,7 @@ libc_support_library(
297297
"//libc:__support_cpp_limits",
298298
"//libc:__support_fputil_fp_bits",
299299
"//libc:__support_fputil_manipulation_functions",
300-
"//libc:internal_includes",
300+
"//libc:llvm_libc_macros_math_macros",
301301
"//libc/test/UnitTest:LibcUnitTest",
302302
],
303303
)
@@ -324,7 +324,7 @@ libc_support_library(
324324
"//libc:__support_fputil_basic_operations",
325325
"//libc:__support_fputil_fenv_impl",
326326
"//libc:__support_fputil_fp_bits",
327-
"//libc:internal_includes",
327+
"//libc:llvm_libc_macros_math_macros",
328328
"//libc/test/UnitTest:LibcUnitTest",
329329
"//libc/test/UnitTest:fp_test_helpers",
330330
],
@@ -352,7 +352,7 @@ libc_support_library(
352352
"//libc:__support_cpp_limits",
353353
"//libc:__support_fputil_fp_bits",
354354
"//libc:__support_fputil_normal_float",
355-
"//libc:internal_includes",
355+
"//libc:llvm_libc_macros_math_macros",
356356
"//libc/test/UnitTest:LibcUnitTest",
357357
"//libc/test/UnitTest:fp_test_helpers",
358358
],
@@ -379,7 +379,7 @@ libc_support_library(
379379
deps = [
380380
"//libc:__support_fputil_fenv_impl",
381381
"//libc:__support_fputil_fp_bits",
382-
"//libc:internal_includes",
382+
"//libc:llvm_libc_macros_math_macros",
383383
"//libc/test/UnitTest:LibcUnitTest",
384384
"//libc/test/UnitTest:fp_test_helpers",
385385
"//libc/utils/MPFRWrapper:mpfr_wrapper",
@@ -416,7 +416,7 @@ libc_support_library(
416416
deps = [
417417
"//libc:__support_fputil_fenv_impl",
418418
"//libc:__support_fputil_fp_bits",
419-
"//libc:internal_includes",
419+
"//libc:llvm_libc_macros_math_macros",
420420
"//libc/test/UnitTest:LibcUnitTest",
421421
"//libc/test/UnitTest:fp_test_helpers",
422422
"//libc/utils/MPFRWrapper:mpfr_wrapper",
@@ -528,7 +528,7 @@ libc_support_library(
528528
"//libc:__support_cpp_type_traits",
529529
"//libc:__support_fputil_basic_operations",
530530
"//libc:__support_fputil_fp_bits",
531-
"//libc:internal_includes",
531+
"//libc:llvm_libc_macros_math_macros",
532532
"//libc/test/UnitTest:LibcUnitTest",
533533
"//libc/test/UnitTest:fp_test_helpers",
534534
],

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)