summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-09 19:00:52 +0000
committerAlp Toker <alp@nuanti.com>2014-06-09 19:00:52 +0000
commit5396370ebb0bbda82f147854fc88a5dda4a68a82 (patch)
treed507a3b0434380bca58beb459de2150276c44875 /lib/Analysis
parentf4cf404837d962c67501ee0e07028801c9b10b6d (diff)
downloadllvm-5396370ebb0bbda82f147854fc88a5dda4a68a82.tar.gz
llvm-5396370ebb0bbda82f147854fc88a5dda4a68a82.tar.bz2
llvm-5396370ebb0bbda82f147854fc88a5dda4a68a82.tar.xz
Remove old fenv.h workaround for a historic clang driver bug
Tested and works fine with clang using libstdc++. All indications are that this was fixed some time ago and isn't a problem with any clang version we support. I've added a note in PR6907 which is still open for some reason. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/ConstantFolding.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp
index 0b6f11ad82..eb3e2c6369 100644
--- a/lib/Analysis/ConstantFolding.cpp
+++ b/lib/Analysis/ConstantFolding.cpp
@@ -39,13 +39,6 @@
#ifdef HAVE_FENV_H
#include <fenv.h>
-#define USE_FENV
-#endif
-
-// FIXME: Clang's #include handling apparently doesn't work for libstdc++'s
-// fenv.h; see PR6907 for details.
-#if defined(__clang__) && defined(_GLIBCXX_FENV_H)
-#undef USE_FENV
#endif
using namespace llvm;
@@ -1329,7 +1322,7 @@ static Constant *GetConstantFoldFPValue(double V, Type *Ty) {
namespace {
/// llvm_fenv_clearexcept - Clear the floating-point exception state.
static inline void llvm_fenv_clearexcept() {
-#if defined(USE_FENV) && HAVE_DECL_FE_ALL_EXCEPT
+#if defined(HAVE_FENV_H) && HAVE_DECL_FE_ALL_EXCEPT
feclearexcept(FE_ALL_EXCEPT);
#endif
errno = 0;
@@ -1340,7 +1333,7 @@ static inline bool llvm_fenv_testexcept() {
int errno_val = errno;
if (errno_val == ERANGE || errno_val == EDOM)
return true;
-#if defined(USE_FENV) && HAVE_DECL_FE_ALL_EXCEPT && HAVE_DECL_FE_INEXACT
+#if defined(HAVE_FENV_H) && HAVE_DECL_FE_ALL_EXCEPT && HAVE_DECL_FE_INEXACT
if (fetestexcept(FE_ALL_EXCEPT & ~FE_INEXACT))
return true;
#endif