assert((Op->getType()->isInteger() || isa<PointerType>(Op->getType())) &&
(Ty->isInteger() || isa<PointerType>(Ty)) &&
"Cannot truncate non-integer value!");
- assert((!Op->getType()->isInteger() || !Ty->isInteger() ||
- Op->getType()->getPrimitiveSizeInBits() >
- Ty->getPrimitiveSizeInBits()) &&
- "This is not a truncating conversion!");
}
SCEVTruncateExpr::~SCEVTruncateExpr() {
assert((Op->getType()->isInteger() || isa<PointerType>(Op->getType())) &&
(Ty->isInteger() || isa<PointerType>(Ty)) &&
"Cannot sign extend non-integer value!");
- assert(Op->getType()->getPrimitiveSizeInBits() < Ty->getPrimitiveSizeInBits()
- && "This is not an extending conversion!");
}
SCEVSignExtendExpr::~SCEVSignExtendExpr() {
//===----------------------------------------------------------------------===//
SCEVHandle ScalarEvolution::getTruncateExpr(const SCEVHandle &Op, const Type *Ty) {
+ assert(getTargetData().getTypeSizeInBits(Op->getType()) >
+ getTargetData().getTypeSizeInBits(Ty) &&
+ "This is not a truncating conversion!");
+
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
return getUnknown(
ConstantExpr::getTrunc(SC->getValue(), Ty));
}
SCEVHandle ScalarEvolution::getSignExtendExpr(const SCEVHandle &Op, const Type *Ty) {
+ assert(getTargetData().getTypeSizeInBits(Op->getType()) <
+ getTargetData().getTypeSizeInBits(Ty) &&
+ "This is not an extending conversion!");
+
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
const Type *IntTy = Ty;
if (isa<PointerType>(IntTy)) IntTy = getTargetData().getIntPtrType();