work around bugs and missing features in apfloat.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42235 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Lex/LiteralSupport.cpp b/Lex/LiteralSupport.cpp
index 3449c27..ae4c1a8 100644
--- a/Lex/LiteralSupport.cpp
+++ b/Lex/LiteralSupport.cpp
@@ -409,13 +409,20 @@
   return OverflowOccurred;
 }
 
-// GetFloatValue - Poor man's floatvalue (FIXME).
 llvm::APFloat NumericLiteralParser::
 GetFloatValue(const llvm::fltSemantics &Format) {
   char floatChars[256];
   strncpy(floatChars, ThisTokBegin, ThisTokEnd-ThisTokBegin);
   floatChars[ThisTokEnd-ThisTokBegin] = '\0';
+#if 0
+  // This doesn't work yet.
   return llvm::APFloat(Format, floatChars);
+#else
+  // FIXME: this is horrible!
+  llvm::APFloat V(strtod(floatChars, 0));
+  V.convert(Format, llvm::APFloat::rmTowardZero);
+  return V;
+#endif
 }
 
 void NumericLiteralParser::Diag(SourceLocation Loc, unsigned DiagID,