[libc] [llvm] [libc] Add proxy header for fenv.h macro constants. #87863 (PR #87896)

via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 6 14:51:03 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 770202343ebce1f2bc0745c78e298e251f204bee e307a31293a68dc5d268a65018516be1231a711b -- libc/hdr/fenv_macros.h libc/AOR_v20.02/math/test/mathtest.c libc/AOR_v20.02/math/test/ulp.c libc/src/__support/FPUtil/FEnvImpl.h libc/src/__support/FPUtil/aarch64/FEnvImpl.h libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h libc/src/__support/FPUtil/arm/FEnvImpl.h libc/src/__support/FPUtil/riscv/FEnvImpl.h libc/src/__support/FPUtil/rounding_mode.h libc/src/__support/FPUtil/x86_64/FEnvImpl.h libc/src/fenv/fegetenv.h libc/src/fenv/fegetexceptflag.cpp libc/src/fenv/fegetexceptflag.h libc/src/fenv/feholdexcept.cpp libc/src/fenv/feholdexcept.h libc/src/fenv/fesetenv.h libc/src/fenv/fesetexceptflag.cpp libc/src/fenv/fesetexceptflag.h libc/src/fenv/feupdateenv.cpp libc/src/fenv/feupdateenv.h libc/test/UnitTest/FPExceptMatcher.cpp libc/test/UnitTest/RoundingModeUtils.cpp libc/test/src/__support/FPUtil/rounding_mode_test.cpp libc/test/src/fenv/enabled_exceptions_test.cpp libc/test/src/fenv/exception_flags_test.cpp libc/test/src/fenv/exception_status_test.cpp libc/test/src/fenv/feclearexcept_test.cpp libc/test/src/fenv/feenableexcept_test.cpp libc/test/src/fenv/feholdexcept_test.cpp libc/test/src/fenv/feupdateenv_test.cpp libc/test/src/fenv/getenv_and_setenv_test.cpp libc/test/src/fenv/rounding_mode_test.cpp libc/test/src/math/RIntTest.h libc/test/src/math/smoke/NextTowardTest.h libc/test/src/math/smoke/RIntTest.h libc/utils/MPFRWrapper/MPFRUtils.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/AOR_v20.02/math/test/mathtest.c b/libc/AOR_v20.02/math/test/mathtest.c
index 9ac5e191d2..1b601795b2 100644
--- a/libc/AOR_v20.02/math/test/mathtest.c
+++ b/libc/AOR_v20.02/math/test/mathtest.c
@@ -6,17 +6,17 @@
  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  */
 
+#include "hdr/fenv_macros.h"
+#include "mathlib.h"
 #include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <setjmp.h>
 #include <ctype.h>
-#include <math.h>
 #include <errno.h>
 #include <limits.h>
-#include "hdr/fenv_macros.h"
-#include "mathlib.h"
+#include <math.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #ifndef math_errhandling
 # define math_errhandling 0
diff --git a/libc/AOR_v20.02/math/test/ulp.c b/libc/AOR_v20.02/math/test/ulp.c
index 7a17228698..d0a97317d7 100644
--- a/libc/AOR_v20.02/math/test/ulp.c
+++ b/libc/AOR_v20.02/math/test/ulp.c
@@ -6,15 +6,15 @@
  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  */
 
-#include <ctype.h>
 #include "hdr/fenv_macros.h"
+#include "mathlib.h"
+#include <ctype.h>
 #include <float.h>
 #include <math.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include "mathlib.h"
 
 /* Don't depend on mpfr by default.  */
 #ifndef USE_MPFR
diff --git a/libc/src/__support/FPUtil/FEnvImpl.h b/libc/src/__support/FPUtil/FEnvImpl.h
index 04ab015a9a..6f9499858f 100644
--- a/libc/src/__support/FPUtil/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/FEnvImpl.h
@@ -9,11 +9,11 @@
 #ifndef LLVM_LIBC_SRC___SUPPORT_FPUTIL_FENVIMPL_H
 #define LLVM_LIBC_SRC___SUPPORT_FPUTIL_FENVIMPL_H
 
+#include "hdr/fenv_macros.h"
 #include "hdr/math_macros.h"
 #include "src/__support/macros/attributes.h" // LIBC_INLINE
 #include "src/__support/macros/properties/architectures.h"
 #include "src/errno/libc_errno.h"
-#include "hdr/fenv_macros.h"
 
 #if defined(LIBC_TARGET_ARCH_IS_AARCH64)
 #if defined(__APPLE__)
diff --git a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
index 05df87a620..6d1f829646 100644
--- a/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
+++ b/libc/src/__support/FPUtil/aarch64/FEnvImpl.h
@@ -16,8 +16,8 @@
 #error "Invalid include"
 #endif
 
-#include <arm_acle.h>
 #include "hdr/fenv_macros.h"
+#include <arm_acle.h>
 #include <stdint.h>
 
 #include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
index 9e11390c9b..906efded52 100644
--- a/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
+++ b/libc/src/__support/FPUtil/aarch64/fenv_darwin_impl.h
@@ -16,8 +16,8 @@
 #error "Invalid include"
 #endif
 
-#include <arm_acle.h>
 #include "hdr/fenv_macros.h"
+#include <arm_acle.h>
 #include <stdint.h>
 
 #include "src/__support/FPUtil/FPBits.h"
diff --git a/libc/test/src/math/RIntTest.h b/libc/test/src/math/RIntTest.h
index 28e596ed0a..c706ff18f1 100644
--- a/libc/test/src/math/RIntTest.h
+++ b/libc/test/src/math/RIntTest.h
@@ -15,8 +15,8 @@
 #include "test/UnitTest/Test.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
 
-#include "hdr/math_macros.h"
 #include "hdr/fenv_macros.h"
+#include "hdr/math_macros.h"
 #include <stdio.h>
 
 namespace mpfr = LIBC_NAMESPACE::testing::mpfr;
diff --git a/libc/test/src/math/smoke/NextTowardTest.h b/libc/test/src/math/smoke/NextTowardTest.h
index 6811685088..b6c1c8d179 100644
--- a/libc/test/src/math/smoke/NextTowardTest.h
+++ b/libc/test/src/math/smoke/NextTowardTest.h
@@ -9,6 +9,7 @@
 #ifndef LLVM_LIBC_TEST_SRC_MATH_NEXTTOWARDTEST_H
 #define LLVM_LIBC_TEST_SRC_MATH_NEXTTOWARDTEST_H
 
+#include "hdr/fenv_macros.h"
 #include "hdr/math_macros.h"
 #include "src/__support/CPP/bit.h"
 #include "src/__support/CPP/type_traits.h"
@@ -16,7 +17,6 @@
 #include "src/__support/FPUtil/FPBits.h"
 #include "test/UnitTest/FPMatcher.h"
 #include "test/UnitTest/Test.h"
-#include "hdr/fenv_macros.h"
 
 #define ASSERT_FP_EQ_WITH_EXCEPTION(result, expected, expected_exception)      \
   ASSERT_FP_EQ(result, expected);                                              \
diff --git a/libc/test/src/math/smoke/RIntTest.h b/libc/test/src/math/smoke/RIntTest.h
index 67894eb1e7..cbed9a3b10 100644
--- a/libc/test/src/math/smoke/RIntTest.h
+++ b/libc/test/src/math/smoke/RIntTest.h
@@ -14,8 +14,8 @@
 #include "test/UnitTest/FPMatcher.h"
 #include "test/UnitTest/Test.h"
 
-#include "hdr/math_macros.h"
 #include "hdr/fenv_macros.h"
+#include "hdr/math_macros.h"
 #include <stdio.h>
 
 static constexpr int ROUNDING_MODES[4] = {FE_UPWARD, FE_DOWNWARD, FE_TOWARDZERO,
diff --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp
index 996756c2b8..349729368e 100644
--- a/libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ b/libc/utils/MPFRWrapper/MPFRUtils.cpp
@@ -14,8 +14,8 @@
 #include "src/__support/FPUtil/fpbits_str.h"
 #include "test/UnitTest/FPMatcher.h"
 
-#include "hdr/math_macros.h"
 #include "hdr/fenv_macros.h"
+#include "hdr/math_macros.h"
 #include <memory>
 #include <stdint.h>
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/87896


More information about the llvm-commits mailing list