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();
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;
}
}