Skip to content

Commit 0646bbc

Browse files
Revert "[libc] Remove direct math.h includes from src" (#85314)
Reverts #84991 Caused build failures
1 parent caba6d1 commit 0646bbc

File tree

8 files changed

+10
-22
lines changed

8 files changed

+10
-22
lines changed

libc/src/__support/FPUtil/FEnvImpl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
#ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_FENVIMPL_H
1010
#define LLVM_LIBC_SRC___SUPPORT_FPUTIL_FENVIMPL_H
1111

12-
#include "include/llvm-libc-macros/math-macros.h"
1312
#include "src/__support/macros/attributes.h" // LIBC_INLINE
1413
#include "src/__support/macros/config.h" // LIBC_HAS_BUILTIN
1514
#include "src/__support/macros/properties/architectures.h"
1615
#include "src/errno/libc_errno.h"
16+
1717
#include <fenv.h>
18+
#include <math.h>
1819

1920
#if defined(LIBC_TARGET_ARCH_IS_AARCH64)
2021
#if defined(__APPLE__)

libc/src/__support/FPUtil/ManipulationFunctions.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
#include "dyadic_float.h"
1616
#include "rounding_mode.h"
1717

18-
#include "include/llvm-libc-macros/math-macros.h"
1918
#include "src/__support/CPP/bit.h"
2019
#include "src/__support/CPP/limits.h" // INT_MAX, INT_MIN
2120
#include "src/__support/CPP/type_traits.h"
2221
#include "src/__support/FPUtil/FEnvImpl.h"
2322
#include "src/__support/macros/attributes.h"
2423
#include "src/__support/macros/optimization.h" // LIBC_UNLIKELY
2524

25+
#include <math.h>
26+
2627
namespace LIBC_NAMESPACE {
2728
namespace fputil {
2829

libc/src/__support/FPUtil/NearestIntegerOperations.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
#include "FPBits.h"
1414
#include "rounding_mode.h"
1515

16-
#include "include/llvm-libc-macros/math-macros.h"
1716
#include "src/__support/CPP/type_traits.h"
1817
#include "src/__support/common.h"
1918

19+
#include <math.h>
20+
2021
namespace LIBC_NAMESPACE {
2122
namespace fputil {
2223

libc/src/math/generic/math_utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
#ifndef LLVM_LIBC_SRC_MATH_GENERIC_MATH_UTILS_H
1010
#define LLVM_LIBC_SRC_MATH_GENERIC_MATH_UTILS_H
1111

12-
#include "include/llvm-libc-macros/math-macros.h"
1312
#include "src/__support/CPP/bit.h"
1413
#include "src/__support/CPP/type_traits.h"
1514
#include "src/__support/common.h"
1615
#include "src/errno/libc_errno.h"
1716

17+
#include <math.h>
18+
1819
#include <stdint.h>
1920

2021
// TODO: evaluate which functions from this file are actually used.

libc/test/src/math/ILogbTest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#ifndef LLVM_LIBC_TEST_SRC_MATH_ILOGBTEST_H
1010
#define LLVM_LIBC_TEST_SRC_MATH_ILOGBTEST_H
1111

12-
#include "include/llvm-libc-macros/math-macros.h"
1312
#include "src/__support/CPP/limits.h" // INT_MAX
1413
#include "src/__support/FPUtil/FPBits.h"
1514
#include "src/__support/FPUtil/ManipulationFunctions.h"
1615
#include "test/UnitTest/Test.h"
16+
#include <math.h>
1717

1818
class LlvmLibcILogbTest : public LIBC_NAMESPACE::testing::Test {
1919
public:

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,7 @@ config_setting(
6262
flag_values = {":mpfr": "system"},
6363
)
6464

65-
################################# Include Files ################################
66-
67-
libc_support_library(
68-
name = "internal_includes",
69-
hdrs = glob([
70-
"include/llvm-libc-macros/*.h",
71-
"include/llvm-libc/types/*",
72-
]),
73-
)
74-
75-
############################### Support libraries ##############################
65+
############################## Support libraries #############################
7666

7767
libc_support_library(
7868
name = "__support_macros_properties_architectures",
@@ -680,7 +670,6 @@ libc_support_library(
680670
":__support_macros_properties_architectures",
681671
":__support_macros_sanitizer",
682672
":errno",
683-
":internal_includes",
684673
],
685674
)
686675

@@ -750,7 +739,6 @@ libc_support_library(
750739
":__support_fputil_normal_float",
751740
":__support_macros_optimization",
752741
":__support_uint128",
753-
":internal_includes",
754742
],
755743
)
756744

@@ -764,7 +752,6 @@ libc_support_library(
764752
":__support_fputil_fp_bits",
765753
":__support_fputil_rounding_mode",
766754
":__support_macros_attributes",
767-
":internal_includes",
768755
],
769756
)
770757

@@ -1186,7 +1173,6 @@ libc_support_library(
11861173
"__support_cpp_type_traits",
11871174
":__support_common",
11881175
":errno",
1189-
":internal_includes",
11901176
],
11911177
)
11921178

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ libc_test(
6464
name = "integer_to_string_test",
6565
srcs = ["integer_to_string_test.cpp"],
6666
deps = [
67-
"//libc:__support_cpp_limits",
6867
"//libc:__support_cpp_span",
6968
"//libc:__support_cpp_limits",
7069
"//libc:__support_cpp_string_view",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ libc_support_library(
296296
"//libc:__support_cpp_limits",
297297
"//libc:__support_fputil_fp_bits",
298298
"//libc:__support_fputil_manipulation_functions",
299-
"//libc:internal_includes",
300299
"//libc/test/UnitTest:LibcUnitTest",
301300
],
302301
)

0 commit comments

Comments
 (0)