summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-12-04 21:58:43 +0000
committerErich Keane <erich.keane@intel.com>2017-12-04 21:58:43 +0000
commit45cf85b415029df1a470514f7f2420a5626fed16 (patch)
tree6be9b26c316f19790d543abccf99632b0c9471bf /clang/lib/Frontend/InitPreprocessor.cpp
parent08615796109fc3a0cc1403803b0d1bab8e6e8828 (diff)
downloadbcm5719-llvm-45cf85b415029df1a470514f7f2420a5626fed16.tar.gz
bcm5719-llvm-45cf85b415029df1a470514f7f2420a5626fed16.zip
Add _Float128 as alias to __float128 to enable compilations on Fedora27/glibc2-26
Fedora27 is using a new version of glibc that refers to the _Float128 type. This patch adds that name as an alias to float128. I also added some predefined macro values for the digits, mantissa, epilon, etc (FloatMacros). For the test case, I copied an existing float128 test. This functionality needs work long term, but it should be sufficient to tread water for a while. At Intel we have test servers running our LLVM compiler with various open source workloads, the server has been upgraded to Fedora27 so many workloads are failing due to _Float128. Patch-By: mibintc Differential Revision: https://reviews.llvm.org/D40673 llvm-svn: 319703
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 719a631a7a6..2d8caa20c06 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -814,6 +814,10 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
DefineFloatMacros(Builder, "FLT", &TI.getFloatFormat(), "F");
DefineFloatMacros(Builder, "DBL", &TI.getDoubleFormat(), "");
DefineFloatMacros(Builder, "LDBL", &TI.getLongDoubleFormat(), "L");
+ if (TI.hasFloat128Type())
+ // FIXME: Switch away from the non-standard "Q" when we can
+ DefineFloatMacros(Builder, "FLT128", &TI.getFloat128Format(), "Q");
+
// Define a __POINTER_WIDTH__ macro for stdint.h.
Builder.defineMacro("__POINTER_WIDTH__",
OpenPOWER on IntegriCloud