public:
/// APSInt ctor - Create an APSInt with the specified width, default to
/// unsigned.
- explicit APSInt(uint32_t BitWidth) : APInt(BitWidth, 0), IsUnsigned(true) {}
+ explicit APSInt(uint32_t BitWidth, bool isUnsigned = true)
+ : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {}
explicit APSInt(const APInt &I, bool isUnsigned = true)
: APInt(I), IsUnsigned(isUnsigned) {}
// The remaining operators just wrap the logic of APInt, but retain the
// signedness information.
- APSInt operator<<(unsigned Bits) {
- return APSInt(static_cast<APInt&>(*this) << Bits, IsUnsigned);
+ APSInt operator<<(unsigned Bits) const {
+ return APSInt(static_cast<const APInt&>(*this) << Bits, IsUnsigned);
}
APSInt& operator<<=(unsigned Amt) {
*this = *this << Amt;
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
return APSInt(static_cast<const APInt&>(*this) - RHS, IsUnsigned);
}
- APSInt operator~() {
+ APSInt operator~() const {
return APSInt(~static_cast<const APInt&>(*this), IsUnsigned);
}