[libc] Rename FEnv.h and refactor subsequent files
authorHedin Garca <hedingarcia@google.com>
Wed, 21 Jul 2021 18:12:29 +0000 (18:12 +0000)
committerHedin García <hedingarcia@google.com>
Thu, 22 Jul 2021 00:07:39 +0000 (00:07 +0000)
Because Windows's pathnames are not case sensitive,
to avoid include conflicts between our header file FEnv.h and the
one from the C Standard library, <fenv.h>, the prior file was renamed.
The motive for the relabel came to fix this include error in
TestHelpers.cpp since a conflict arose with a file in the same
directory when #include <fenv.h> was being used.

Reviewed By: sivachandra, aeubanks

Differential Revision: https://reviews.llvm.org/D106470

26 files changed:
libc/src/fenv/feclearexcept.cpp
libc/src/fenv/fegetenv.cpp
libc/src/fenv/fegetexceptflag.cpp
libc/src/fenv/fegetround.cpp
libc/src/fenv/feholdexcept.cpp
libc/src/fenv/feraiseexcept.cpp
libc/src/fenv/fesetenv.cpp
libc/src/fenv/fesetexceptflag.cpp
libc/src/fenv/fesetround.cpp
libc/src/fenv/fetestexcept.cpp
libc/src/fenv/feupdateenv.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/feholdexcept_test.cpp
libc/test/src/fenv/feupdateenv_test.cpp
libc/test/src/fenv/getenv_and_setenv_test.cpp
libc/test/src/math/RIntTest.h
libc/test/src/math/RoundToIntegerTest.h
libc/utils/FPUtil/CMakeLists.txt
libc/utils/FPUtil/DummyFEnvImpl.h [moved from libc/utils/FPUtil/DummyFEnv.h with 86% similarity]
libc/utils/FPUtil/FEnvUtils.h [moved from libc/utils/FPUtil/FEnv.h with 66% similarity]
libc/utils/FPUtil/NearestIntegerOperations.h
libc/utils/FPUtil/aarch64/FEnvImpl.h [moved from libc/utils/FPUtil/aarch64/FEnv.h with 97% similarity]
libc/utils/FPUtil/x86_64/FEnvImpl.h [moved from libc/utils/FPUtil/x86_64/FEnv.h with 98% similarity]

index b0aa763..8929723 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/feclearexcept.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 namespace __llvm_libc {
 
index 28fef8a..0988499 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/fegetenv.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 namespace __llvm_libc {
 
index 24620b0..be5c93e 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/fegetexceptflag.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 #include <fenv.h>
 
index 3e198f6..88c3b23 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/fegetround.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 namespace __llvm_libc {
 
index 76a82d2..890db42 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/feholdexcept.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 #include <fenv.h>
 
index 77128ff..beb4099 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/feraiseexcept.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 namespace __llvm_libc {
 
index 5f6ede8..ec0b7cb 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/fesetenv.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 namespace __llvm_libc {
 
index 9ee6205..851b13e 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/fesetexceptflag.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 #include <fenv.h>
 
index 5abd372..25b51e7 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/fesetround.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 namespace __llvm_libc {
 
index 4f698dc..e33319c 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/fetestexcept.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 namespace __llvm_libc {
 
index ff45991..f3f6e36 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/feupdateenv.h"
 #include "src/__support/common.h"
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 
 #include <fenv.h>
 
index 980c2c0..52191e0 100644 (file)
@@ -10,7 +10,7 @@
 #include "src/fenv/feraiseexcept.h"
 #include "src/fenv/fetestexcept.h"
 
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #include "utils/FPUtil/TestHelpers.h"
 #include "utils/UnitTest/Test.h"
 
index 855ba7c..e92447d 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/fenv/fegetexceptflag.h"
 #include "src/fenv/fesetexceptflag.h"
 
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #include "utils/UnitTest/Test.h"
 
 #include <fenv.h>
index 12a65bd..734d478 100644 (file)
@@ -10,7 +10,7 @@
 #include "src/fenv/feraiseexcept.h"
 #include "src/fenv/fetestexcept.h"
 
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #include "utils/UnitTest/Test.h"
 
 #include <fenv.h>
index dfdc29d..304ecc0 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/feclearexcept.h"
 
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #include "utils/UnitTest/Test.h"
 
 #include <fenv.h>
index 0b860a9..3cb305a 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/feholdexcept.h"
 
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #include "utils/FPUtil/TestHelpers.h"
 #include "utils/UnitTest/Test.h"
 
index da40ab1..d1953d8 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "src/fenv/feupdateenv.h"
 
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #include "utils/UnitTest/Test.h"
 
 #include <fenv.h>
index ebd6d47..55e20c3 100644 (file)
@@ -9,7 +9,7 @@
 #include "src/fenv/fegetenv.h"
 #include "src/fenv/fesetenv.h"
 
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #include "utils/UnitTest/Test.h"
 
 #include <fenv.h>
index edcc279..1f7200d 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_TEST_SRC_MATH_RINTTEST_H
 #define LLVM_LIBC_TEST_SRC_MATH_RINTTEST_H
 
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #include "utils/FPUtil/FPBits.h"
 #include "utils/FPUtil/TestHelpers.h"
 #include "utils/MPFRWrapper/MPFRUtils.h"
index 2dcb2c9..a06fba8 100644 (file)
@@ -18,7 +18,7 @@
 #include <errno.h>
 #endif
 #if math_errhandling & MATH_ERREXCEPT
-#include "utils/FPUtil/FEnv.h"
+#include "utils/FPUtil/FEnvUtils.h"
 #endif
 
 namespace mpfr = __llvm_libc::testing::mpfr;
index 7b6daff..49c594a 100644 (file)
@@ -5,9 +5,9 @@ else()
 endif()
 
 if(EXISTS ${LIBC_TARGET_ARCHITECTURE})
-  set(FENV_IMPL ${LIBC_TARGET_ARCHITECTURE}/FEnv.h)
+  set(FENV_IMPL ${LIBC_TARGET_ARCHITECTURE}/FEnvImpl.h)
 else()
-  set(FENV_IMPL DummyFEnv.h)
+  set(FENV_IMPL DummyFEnvImpl.h)
 endif()
 
 add_header_library(
@@ -17,7 +17,7 @@ add_header_library(
     ${FENV_IMPL}
     BasicOperations.h
     DivisionAndRemainderOperations.h
-    FEnv.h
+    FEnvUtils.h
     FloatProperties.h
     FPBits.h
     BasicOperations.h
similarity index 86%
rename from libc/utils/FPUtil/DummyFEnv.h
rename to libc/utils/FPUtil/DummyFEnvImpl.h
index 216749f..8e983dd 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_UTILS_FPUTIL_DUMMY_FENV_H
-#define LLVM_LIBC_UTILS_FPUTIL_DUMMY_FENV_H
+#ifndef LLVM_LIBC_UTILS_FPUTIL_DUMMY_FENVIMPL_H
+#define LLVM_LIBC_UTILS_FPUTIL_DUMMY_FENVIMPL_H
 
 #include <fenv.h>
 #include <math.h>
@@ -36,4 +36,4 @@ static inline int setEnv(const fenv_t *) { return 0; }
 } // namespace fputil
 } // namespace __llvm_libc
 
-#endif // LLVM_LIBC_UTILS_FPUTIL_DUMMY_FENV_H
+#endif // LLVM_LIBC_UTILS_FPUTIL_DUMMY_FENVIMPL_H
similarity index 66%
rename from libc/utils/FPUtil/FEnv.h
rename to libc/utils/FPUtil/FEnvUtils.h
index 1634f5f..2013830 100644 (file)
@@ -6,15 +6,15 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_UTILS_FPUTIL_FENV_H
-#define LLVM_LIBC_UTILS_FPUTIL_FENV_H
+#ifndef LLVM_LIBC_UTILS_FPUTIL_FENVUTILS_H
+#define LLVM_LIBC_UTILS_FPUTIL_FENVUTILS_H
 
 #ifdef __x86_64__
-#include "x86_64/FEnv.h"
+#include "x86_64/FEnvImpl.h"
 #elif defined(__aarch64__)
-#include "aarch64/FEnv.h"
+#include "aarch64/FEnvImpl.h"
 #else
-#include "DummyFEnv.h"
+#include "DummyFEnvImpl.h"
 #endif
 
-#endif // LLVM_LIBC_UTILS_FPUTIL_FP_BITS_H
+#endif // LLVM_LIBC_UTILS_FPUTIL_FENVUTILS_H
index a5f7e17..8dc4e23 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef LLVM_LIBC_UTILS_FPUTIL_NEAREST_INTEGER_OPERATIONS_H
 #define LLVM_LIBC_UTILS_FPUTIL_NEAREST_INTEGER_OPERATIONS_H
 
-#include "FEnv.h"
+#include "FEnvUtils.h"
 #include "FPBits.h"
 
 #include "utils/CPP/TypeTraits.h"
similarity index 97%
rename from libc/utils/FPUtil/aarch64/FEnv.h
rename to libc/utils/FPUtil/aarch64/FEnvImpl.h
index 93af9a2..1c7ac85 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_UTILS_FPUTIL_AARCH64_FENV_H
-#define LLVM_LIBC_UTILS_FPUTIL_AARCH64_FENV_H
+#ifndef LLVM_LIBC_UTILS_FPUTIL_AARCH64_FENVIMPL_H
+#define LLVM_LIBC_UTILS_FPUTIL_AARCH64_FENVIMPL_H
 
 #include <arm_acle.h>
 #include <fenv.h>
@@ -232,4 +232,4 @@ static inline int setEnv(const fenv_t *envp) {
 } // namespace fputil
 } // namespace __llvm_libc
 
-#endif // LLVM_LIBC_UTILS_FPUTIL_AARCH64_FENV_H
+#endif // LLVM_LIBC_UTILS_FPUTIL_AARCH64_FENVIMPL_H
similarity index 98%
rename from libc/utils/FPUtil/x86_64/FEnv.h
rename to libc/utils/FPUtil/x86_64/FEnvImpl.h
index 8ae10af..b67222b 100644 (file)
@@ -6,8 +6,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_LIBC_UTILS_FPUTIL_X86_64_FENV_H
-#define LLVM_LIBC_UTILS_FPUTIL_X86_64_FENV_H
+#ifndef LLVM_LIBC_UTILS_FPUTIL_X86_64_FENVIMPL_H
+#define LLVM_LIBC_UTILS_FPUTIL_X86_64_FENVIMPL_H
 
 #include <fenv.h>
 #include <stdint.h>
@@ -370,4 +370,4 @@ static inline int setEnv(const fenv_t *envp) {
 } // namespace fputil
 } // namespace __llvm_libc
 
-#endif // LLVM_LIBC_UTILS_FPUTIL_X86_64_FENV_H
+#endif // LLVM_LIBC_UTILS_FPUTIL_X86_64_FENVIMPL_H