Change:
[oota-llvm.git] / lib / VMCore / Constants.cpp
index 8b41ab75e25665d4985062cd6966b7d68e40aae7..a84a046bb9981e67f25b540247cfc51ca53e14db 100644 (file)
@@ -65,9 +65,9 @@ bool Constant::isNullValue() const {
 bool Constant::isAllOnesValue() const {
   // Check for -1 integers
   if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
-    return CI->isAllOnesValue();
+    return CI->isMinusOne();
 
-  // +0.0 is null.
+  // Check for FP which are bitcasted from -1 integers
   if (const ConstantFP *CFP = dyn_cast<ConstantFP>(this))
     return CFP->getValueAPF().bitcastToAPInt().isAllOnesValue();
 
@@ -105,7 +105,7 @@ Constant *Constant::getNullValue(Type *Ty) {
     return ConstantAggregateZero::get(Ty);
   default:
     // Function, Label, or Opaque type?
-    assert(!"Cannot create a null constant of that type!");
+    assert(0 && "Cannot create a null constant of that type!");
     return 0;
   }
 }