add a version of the APFloat constructor that initializes to 0.0
authorChris Lattner <sabre@nondot.org>
Thu, 17 Sep 2009 01:08:43 +0000 (01:08 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 Sep 2009 01:08:43 +0000 (01:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82110 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/APFloat.h
lib/Support/APFloat.cpp

index d38d8319eeee445667500909f835576e85ab9c26..4d7e7ae11e8b2a8a9f6361531318ebee997e1fe7 100644 (file)
@@ -173,6 +173,7 @@ namespace llvm {
     };
 
     // Constructors.
+    APFloat(const fltSemantics &); // Default construct to 0.0
     APFloat(const fltSemantics &, const StringRef &);
     APFloat(const fltSemantics &, integerPart);
     APFloat(const fltSemantics &, fltCategory, bool negative, unsigned type=0);
index d50e4e560181f7de33ff27771216094b0f97407a..bcf3d6d012525a554182f8fc20b4d25658304af4 100644 (file)
@@ -692,6 +692,14 @@ APFloat::APFloat(const fltSemantics &ourSemantics, integerPart value)
   normalize(rmNearestTiesToEven, lfExactlyZero);
 }
 
+APFloat::APFloat(const fltSemantics &ourSemantics) {
+  assertArithmeticOK(ourSemantics);
+  initialize(&ourSemantics);
+  category = fcZero;
+  sign = false;
+}
+
+
 APFloat::APFloat(const fltSemantics &ourSemantics,
                  fltCategory ourCategory, bool negative, unsigned type)
 {