Use APFloat for the representation of FP immediates, ask the target
for *which* apfloat to use for a particular type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42234 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Lex/LiteralSupport.cpp b/Lex/LiteralSupport.cpp
index c2bdd8e..3449c27 100644
--- a/Lex/LiteralSupport.cpp
+++ b/Lex/LiteralSupport.cpp
@@ -17,7 +17,6 @@
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Basic/TargetInfo.h"
-#include "llvm/ADT/APInt.h"
 #include "llvm/ADT/StringExtras.h"
 using namespace clang;
 
@@ -411,11 +410,12 @@
 }
 
 // GetFloatValue - Poor man's floatvalue (FIXME).
-float NumericLiteralParser::GetFloatValue() {
+llvm::APFloat NumericLiteralParser::
+GetFloatValue(const llvm::fltSemantics &Format) {
   char floatChars[256];
   strncpy(floatChars, ThisTokBegin, ThisTokEnd-ThisTokBegin);
   floatChars[ThisTokEnd-ThisTokBegin] = '\0';
-  return (float)strtod(floatChars, 0);
+  return llvm::APFloat(Format, floatChars);
 }
 
 void NumericLiteralParser::Diag(SourceLocation Loc, unsigned DiagID,