[libc-commits] [libc] 049cfc4 - [libc] Rename FEnv.h and refactor subsequent files

Hedin GarcĂ­a via libc-commits libc-commits at lists.llvm.org
Wed Jul 21 17:08:05 PDT 2021


Author: Hedin Garca
Date: 2021-07-22T00:07:39Z
New Revision: 049cfc464d1718c5cd97fa8a8ddf0fc36e101f98

URL: https://github.com/llvm/llvm-project/commit/049cfc464d1718c5cd97fa8a8ddf0fc36e101f98
DIFF: https://github.com/llvm/llvm-project/commit/049cfc464d1718c5cd97fa8a8ddf0fc36e101f98.diff

LOG: [libc] Rename FEnv.h and refactor subsequent files

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

Added: 
    libc/utils/FPUtil/DummyFEnvImpl.h
    libc/utils/FPUtil/FEnvUtils.h
    libc/utils/FPUtil/aarch64/FEnvImpl.h
    libc/utils/FPUtil/x86_64/FEnvImpl.h

Modified: 
    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/NearestIntegerOperations.h

Removed: 
    libc/utils/FPUtil/DummyFEnv.h
    libc/utils/FPUtil/FEnv.h
    libc/utils/FPUtil/aarch64/FEnv.h
    libc/utils/FPUtil/x86_64/FEnv.h


################################################################################
diff  --git a/libc/src/fenv/feclearexcept.cpp b/libc/src/fenv/feclearexcept.cpp
index b0aa7631fef83..89297234ea3e7 100644
--- a/libc/src/fenv/feclearexcept.cpp
+++ b/libc/src/fenv/feclearexcept.cpp
@@ -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 {
 

diff  --git a/libc/src/fenv/fegetenv.cpp b/libc/src/fenv/fegetenv.cpp
index 28fef8a699af2..0988499f377e5 100644
--- a/libc/src/fenv/fegetenv.cpp
+++ b/libc/src/fenv/fegetenv.cpp
@@ -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 {
 

diff  --git a/libc/src/fenv/fegetexceptflag.cpp b/libc/src/fenv/fegetexceptflag.cpp
index 24620b0f01648..be5c93e7d91cf 100644
--- a/libc/src/fenv/fegetexceptflag.cpp
+++ b/libc/src/fenv/fegetexceptflag.cpp
@@ -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>
 

diff  --git a/libc/src/fenv/fegetround.cpp b/libc/src/fenv/fegetround.cpp
index 3e198f66c3897..88c3b2354838c 100644
--- a/libc/src/fenv/fegetround.cpp
+++ b/libc/src/fenv/fegetround.cpp
@@ -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 {
 

diff  --git a/libc/src/fenv/feholdexcept.cpp b/libc/src/fenv/feholdexcept.cpp
index 76a82d2800ebd..890db42b3e004 100644
--- a/libc/src/fenv/feholdexcept.cpp
+++ b/libc/src/fenv/feholdexcept.cpp
@@ -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>
 

diff  --git a/libc/src/fenv/feraiseexcept.cpp b/libc/src/fenv/feraiseexcept.cpp
index 77128ff98d199..beb4099a71d08 100644
--- a/libc/src/fenv/feraiseexcept.cpp
+++ b/libc/src/fenv/feraiseexcept.cpp
@@ -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 {
 

diff  --git a/libc/src/fenv/fesetenv.cpp b/libc/src/fenv/fesetenv.cpp
index 5f6ede84da9cb..ec0b7cb1f5882 100644
--- a/libc/src/fenv/fesetenv.cpp
+++ b/libc/src/fenv/fesetenv.cpp
@@ -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 {
 

diff  --git a/libc/src/fenv/fesetexceptflag.cpp b/libc/src/fenv/fesetexceptflag.cpp
index 9ee6205d3a6cc..851b13e4012d2 100644
--- a/libc/src/fenv/fesetexceptflag.cpp
+++ b/libc/src/fenv/fesetexceptflag.cpp
@@ -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>
 

diff  --git a/libc/src/fenv/fesetround.cpp b/libc/src/fenv/fesetround.cpp
index 5abd372215c7b..25b51e73043f9 100644
--- a/libc/src/fenv/fesetround.cpp
+++ b/libc/src/fenv/fesetround.cpp
@@ -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 {
 

diff  --git a/libc/src/fenv/fetestexcept.cpp b/libc/src/fenv/fetestexcept.cpp
index 4f698dc196ae3..e33319c3ac40e 100644
--- a/libc/src/fenv/fetestexcept.cpp
+++ b/libc/src/fenv/fetestexcept.cpp
@@ -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 {
 

diff  --git a/libc/src/fenv/feupdateenv.cpp b/libc/src/fenv/feupdateenv.cpp
index ff45991d4ce70..f3f6e36aac3d1 100644
--- a/libc/src/fenv/feupdateenv.cpp
+++ b/libc/src/fenv/feupdateenv.cpp
@@ -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>
 

diff  --git a/libc/test/src/fenv/enabled_exceptions_test.cpp b/libc/test/src/fenv/enabled_exceptions_test.cpp
index 980c2c0dffdd1..52191e00b64c7 100644
--- a/libc/test/src/fenv/enabled_exceptions_test.cpp
+++ b/libc/test/src/fenv/enabled_exceptions_test.cpp
@@ -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"
 

diff  --git a/libc/test/src/fenv/exception_flags_test.cpp b/libc/test/src/fenv/exception_flags_test.cpp
index 855ba7c9248d2..e92447d57eaeb 100644
--- a/libc/test/src/fenv/exception_flags_test.cpp
+++ b/libc/test/src/fenv/exception_flags_test.cpp
@@ -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>

diff  --git a/libc/test/src/fenv/exception_status_test.cpp b/libc/test/src/fenv/exception_status_test.cpp
index 12a65bd116f90..734d4786d86dc 100644
--- a/libc/test/src/fenv/exception_status_test.cpp
+++ b/libc/test/src/fenv/exception_status_test.cpp
@@ -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>

diff  --git a/libc/test/src/fenv/feclearexcept_test.cpp b/libc/test/src/fenv/feclearexcept_test.cpp
index dfdc29dc85fba..304ecc0ab98bd 100644
--- a/libc/test/src/fenv/feclearexcept_test.cpp
+++ b/libc/test/src/fenv/feclearexcept_test.cpp
@@ -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>

diff  --git a/libc/test/src/fenv/feholdexcept_test.cpp b/libc/test/src/fenv/feholdexcept_test.cpp
index 0b860a9534514..3cb305a82ce28 100644
--- a/libc/test/src/fenv/feholdexcept_test.cpp
+++ b/libc/test/src/fenv/feholdexcept_test.cpp
@@ -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"
 

diff  --git a/libc/test/src/fenv/feupdateenv_test.cpp b/libc/test/src/fenv/feupdateenv_test.cpp
index da40ab18622a9..d1953d8a17fdc 100644
--- a/libc/test/src/fenv/feupdateenv_test.cpp
+++ b/libc/test/src/fenv/feupdateenv_test.cpp
@@ -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>

diff  --git a/libc/test/src/fenv/getenv_and_setenv_test.cpp b/libc/test/src/fenv/getenv_and_setenv_test.cpp
index ebd6d47707bdb..55e20c3da3125 100644
--- a/libc/test/src/fenv/getenv_and_setenv_test.cpp
+++ b/libc/test/src/fenv/getenv_and_setenv_test.cpp
@@ -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>

diff  --git a/libc/test/src/math/RIntTest.h b/libc/test/src/math/RIntTest.h
index edcc27993299c..1f7200dfc6aea 100644
--- a/libc/test/src/math/RIntTest.h
+++ b/libc/test/src/math/RIntTest.h
@@ -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"

diff  --git a/libc/test/src/math/RoundToIntegerTest.h b/libc/test/src/math/RoundToIntegerTest.h
index 2dcb2c9a6bf98..a06fba8e8e0cd 100644
--- a/libc/test/src/math/RoundToIntegerTest.h
+++ b/libc/test/src/math/RoundToIntegerTest.h
@@ -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;

diff  --git a/libc/utils/FPUtil/CMakeLists.txt b/libc/utils/FPUtil/CMakeLists.txt
index 7b6daff72179e..49c594af1c1db 100644
--- a/libc/utils/FPUtil/CMakeLists.txt
+++ b/libc/utils/FPUtil/CMakeLists.txt
@@ -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

diff  --git a/libc/utils/FPUtil/DummyFEnv.h b/libc/utils/FPUtil/DummyFEnvImpl.h
similarity index 86%
rename from libc/utils/FPUtil/DummyFEnv.h
rename to libc/utils/FPUtil/DummyFEnvImpl.h
index 216749fc538d4..8e983dd11ce96 100644
--- a/libc/utils/FPUtil/DummyFEnv.h
+++ b/libc/utils/FPUtil/DummyFEnvImpl.h
@@ -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

diff  --git a/libc/utils/FPUtil/FEnv.h b/libc/utils/FPUtil/FEnvUtils.h
similarity index 66%
rename from libc/utils/FPUtil/FEnv.h
rename to libc/utils/FPUtil/FEnvUtils.h
index 1634f5f101253..201383053ebce 100644
--- a/libc/utils/FPUtil/FEnv.h
+++ b/libc/utils/FPUtil/FEnvUtils.h
@@ -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

diff  --git a/libc/utils/FPUtil/NearestIntegerOperations.h b/libc/utils/FPUtil/NearestIntegerOperations.h
index a5f7e17d2304b..8dc4e23ce75c1 100644
--- a/libc/utils/FPUtil/NearestIntegerOperations.h
+++ b/libc/utils/FPUtil/NearestIntegerOperations.h
@@ -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"

diff  --git a/libc/utils/FPUtil/aarch64/FEnv.h b/libc/utils/FPUtil/aarch64/FEnvImpl.h
similarity index 97%
rename from libc/utils/FPUtil/aarch64/FEnv.h
rename to libc/utils/FPUtil/aarch64/FEnvImpl.h
index 93af9a219d036..1c7ac85652b00 100644
--- a/libc/utils/FPUtil/aarch64/FEnv.h
+++ b/libc/utils/FPUtil/aarch64/FEnvImpl.h
@@ -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

diff  --git a/libc/utils/FPUtil/x86_64/FEnv.h b/libc/utils/FPUtil/x86_64/FEnvImpl.h
similarity index 98%
rename from libc/utils/FPUtil/x86_64/FEnv.h
rename to libc/utils/FPUtil/x86_64/FEnvImpl.h
index 8ae10afde084f..b67222b892436 100644
--- a/libc/utils/FPUtil/x86_64/FEnv.h
+++ b/libc/utils/FPUtil/x86_64/FEnvImpl.h
@@ -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


        


More information about the libc-commits mailing list