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/tools/llvm-upgrade/UpgradeInternals.h b/tools/llvm-upgrade/UpgradeInternals.h
index 0e00400..756a86a 100644
--- a/tools/llvm-upgrade/UpgradeInternals.h
+++ b/tools/llvm-upgrade/UpgradeInternals.h
@@ -159,7 +159,7 @@
     char    *Name;        // If it's a named reference.  Memory must be free'd.
     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;
   };
@@ -187,7 +187,7 @@
     return D;
   }
 
-  static ValID create(double Val) {
+  static ValID create(APFloat* Val) {
     ValID D; D.Type = ConstFPVal; D.ConstPoolFP = Val;
     D.S.makeSignless();
     return D;
@@ -245,7 +245,7 @@
     switch (Type) {
     case NumberVal     : return std::string("#") + itostr(Num);
     case NameVal       : return Name;
-    case ConstFPVal    : return ftostr(ConstPoolFP);
+    case ConstFPVal    : return ftostr(*ConstPoolFP);
     case ConstNullVal  : return "null";
     case ConstUndefVal : return "undef";
     case ConstZeroVal  : return "zeroinitializer";
@@ -271,7 +271,8 @@
     case NameVal:       return strcmp(Name, V.Name) < 0;
     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;