Lower(L), Upper(U) {
assert(L.getBitWidth() == U.getBitWidth() &&
"ConstantRange with unequal bit widths");
- uint32_t BitWidth = L.getBitWidth();
- assert((L != U || (L == APInt::getMaxValue(BitWidth) ||
- L == APInt::getMinValue(BitWidth))) &&
+ assert((L != U || (L.isMaxValue() || L.isMinValue())) &&
"Lower == Upper, but they aren't min or max value!");
}
/// isFullSet - Return true if this set contains all of the elements possible
/// for this data-type
bool ConstantRange::isFullSet() const {
- return Lower == Upper && Lower == APInt::getMaxValue(getBitWidth());
+ return Lower == Upper && Lower.isMaxValue();
}
/// isEmptySet - Return true if this set contains no members.
///
bool ConstantRange::isEmptySet() const {
- return Lower == Upper && Lower == APInt::getMinValue(getBitWidth());
+ return Lower == Upper && Lower.isMinValue();
}
/// isWrappedSet - Return true if this set wraps around the top of the range,
return ConstantRange(APInt::getSignedMinValue(W), CR.getSignedMax());
case ICmpInst::ICMP_ULE: {
APInt UMax(CR.getUnsignedMax());
- if (UMax == APInt::getMaxValue(W))
+ if (UMax.isMaxValue())
return ConstantRange(W);
return ConstantRange(APInt::getMinValue(W), UMax + 1);
}
case ICmpInst::ICMP_SLE: {
APInt SMax(CR.getSignedMax());
- if (SMax == APInt::getSignedMaxValue(W) ||
- SMax + 1 == APInt::getSignedMaxValue(W))
+ if (SMax.isMaxSignedValue() || (SMax+1).isMaxSignedValue())
return ConstantRange(W);
return ConstantRange(APInt::getSignedMinValue(W), SMax + 1);
}
APInt::getSignedMinValue(W));
case ICmpInst::ICMP_UGE: {
APInt UMin(CR.getUnsignedMin());
- if (UMin == APInt::getMinValue(W))
+ if (UMin.isMinValue())
return ConstantRange(W);
return ConstantRange(UMin, APInt::getNullValue(W));
}
case ICmpInst::ICMP_SGE: {
APInt SMin(CR.getSignedMin());
- if (SMin == APInt::getSignedMinValue(W))
+ if (SMin.isMinSignedValue())
return ConstantRange(W);
return ConstantRange(SMin, APInt::getSignedMinValue(W));
}