Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double.  Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AsmParser/ParserInternals.h b/lib/AsmParser/ParserInternals.h
index e315902..61de652 100644
--- a/lib/AsmParser/ParserInternals.h
+++ b/lib/AsmParser/ParserInternals.h
@@ -22,7 +22,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Assembly/Parser.h"
 #include "llvm/ADT/StringExtras.h"
-
+#include "llvm/ADT/APFloat.h"
 
 // Global variables exported from the lexer...
 
@@ -93,10 +93,10 @@
     std::string *Name;    // If it's a named reference.  Memory must be deleted.
     int64_t  ConstPool64; // Constant pool reference.  This is the value
     uint64_t UConstPool64;// Unsigned constant pool reference.
-    double   ConstPoolFP; // Floating point constant pool reference
+    APFloat *ConstPoolFP; // Floating point constant pool reference
     Constant *ConstantValue; // Fully resolved constant for ConstantVal case.
     InlineAsmDescriptor *IAD;
-  };
+ };
 
   static ValID createLocalID(unsigned Num) {
     ValID D; D.Type = LocalID; D.Num = Num; return D;
@@ -119,7 +119,7 @@
     ValID D; D.Type = ConstUIntVal; D.UConstPool64 = Val; return D;
   }
 
-  static ValID create(double Val) {
+  static ValID create(APFloat *Val) {
     ValID D; D.Type = ConstFPVal; D.ConstPoolFP = Val; return D;
   }
 
@@ -168,7 +168,7 @@
     case GlobalID      : return '@' + utostr(Num);
     case LocalName     : return *Name;
     case GlobalName    : return *Name;
-    case ConstFPVal    : return ftostr(ConstPoolFP);
+    case ConstFPVal    : return ftostr(*ConstPoolFP);
     case ConstNullVal  : return "null";
     case ConstUndefVal : return "undef";
     case ConstZeroVal  : return "zeroinitializer";
@@ -194,7 +194,8 @@
     case GlobalName:    return *Name < *V.Name;
     case ConstSIntVal:  return ConstPool64  < V.ConstPool64;
     case ConstUIntVal:  return UConstPool64 < V.UConstPool64;
-    case ConstFPVal:    return ConstPoolFP  < V.ConstPoolFP;
+    case ConstFPVal:    return ConstPoolFP->compare(*V.ConstPoolFP) ==
+                               APFloat::cmpLessThan;
     case ConstNullVal:  return false;
     case ConstUndefVal: return false;
     case ConstZeroVal: return false;
@@ -212,7 +213,8 @@
         case GlobalName: return *Name == *(V.Name);
         case ConstSIntVal:  return ConstPool64  == V.ConstPool64;
         case ConstUIntVal:  return UConstPool64 == V.UConstPool64;
-        case ConstFPVal:    return ConstPoolFP  == V.ConstPoolFP;
+        case ConstFPVal:    return ConstPoolFP->compare(*V.ConstPoolFP) == 
+                                   APFloat::cmpEqual;
         case ConstantVal:   return ConstantValue == V.ConstantValue;
         case ConstNullVal:  return true;
         case ConstUndefVal: return true;