using namespace llvm;
static ConstantIntegral *Next(ConstantIntegral *CI) {
- if (CI->getType() == Type::BoolTy)
- return CI == ConstantBool::True ? ConstantBool::False : ConstantBool::True;
+ if (ConstantBool *CB = dyn_cast<ConstantBool>(CI))
+ return ConstantBool::get(!CB->getValue());
Constant *Result = ConstantExpr::getAdd(CI,
ConstantInt::get(CI->getType(), 1));
// Simply subtract the bounds...
Constant *Result = ConstantExpr::getSub(Upper, Lower);
- return cast<ConstantInt>(Result)->getRawValue();
+ return cast<ConstantInt>(Result)->getZExtValue();
}
/// contains - Return true if the specified value is in the set.
// Change a source full set into [0, 1 << 8*numbytes)
unsigned SrcTySize = getLower()->getType()->getPrimitiveSize();
return ConstantRange(Constant::getNullValue(Ty),
- ConstantUInt::get(Ty, 1ULL << SrcTySize*8));
+ ConstantInt::get(Ty, 1ULL << SrcTySize*8));
}
Constant *Lower = getLower();