[llvm-commits] [llvm] r41784 - /llvm/trunk/include/llvm/ADT/APFloat.h

Chuck Rose III cfr at adobe.com
Fri Sep 7 21:17:09 PDT 2007


Author: cfr
Date: Fri Sep  7 23:17:08 2007
New Revision: 41784

URL: http://llvm.org/viewvc/llvm-project?rev=41784&view=rev
Log:
Fix for VisualStudio.  It is treating a 2 bit enum as a signed int for comparison purposes, causing failures.  Using an extra bit fixes it.

Modified:
    llvm/trunk/include/llvm/ADT/APFloat.h

Modified: llvm/trunk/include/llvm/ADT/APFloat.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APFloat.h?rev=41784&r1=41783&r2=41784&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/APFloat.h (original)
+++ llvm/trunk/include/llvm/ADT/APFloat.h Fri Sep  7 23:17:08 2007
@@ -276,7 +276,9 @@
     exponent_t exponent;
 
     /* What kind of floating point number this is.  */
-    fltCategory category: 2;
+    /* Only 2 bits are required, but VisualStudio incorrectly sign extends 
+       it.  Using the extra bit keeps it from failing under VisualStudio */
+    fltCategory category: 3;
 
     /* The sign bit of this number.  */
     unsigned int sign: 1;





More information about the llvm-commits mailing list