[llvm] r184711 - [APFloat] Removed a assert from significandParts() which says that one can only access the significand of FiniteNonZero/NaN floats.

Michael Gottesman mgottesman at apple.com
Mon Jun 24 02:57:59 PDT 2013


Author: mgottesman
Date: Mon Jun 24 04:57:59 2013
New Revision: 184711

URL: http://llvm.org/viewvc/llvm-project?rev=184711&view=rev
Log:
[APFloat] Removed a assert from significandParts() which says that one can only access the significand of FiniteNonZero/NaN floats.

The method significandParts() is a helper method meant to ease access to
APFloat's significand by allowing the user to not need to be aware of whether or
not the APFloat is using memory allocated in the instance itself or in an
external array.

This assert says that one can only access the significand of FiniteNonZero/NaN
floats. This makes it cumbersome and more importantly dangerous when one wishes
to zero out the significand of a zero/infinity value since one will have to deal
with the aforementioned quandary related to how the memory in APFloat is
allocated.

Modified:
    llvm/trunk/lib/Support/APFloat.cpp

Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=184711&r1=184710&r2=184711&view=diff
==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Mon Jun 24 04:57:59 2013
@@ -847,8 +847,6 @@ APFloat::significandParts() const
 integerPart *
 APFloat::significandParts()
 {
-  assert(category == fcNormal || category == fcNaN);
-
   if (partCount() > 1)
     return significand.parts;
   else





More information about the llvm-commits mailing list