add missing methods, mark stuff const

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35862 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-04-10 07:06:21 +00:00
parent 99b1b38818
commit 403949ea93

View File

@ -68,13 +68,21 @@ public:
*this = sdiv(RHS);
return *this;
}
APSInt operator%(const APSInt &RHS) const {
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
return IsUnsigned ? urem(RHS) : srem(RHS);
}
APSInt operator/(const APSInt &RHS) const {
assert(IsUnsigned == RHS.IsUnsigned && "Signedness mismatch!");
return IsUnsigned ? udiv(RHS) : sdiv(RHS);
}
const APSInt &operator>>=(unsigned Amt) {
*this = *this >> Amt;
return *this;
}
APSInt operator>>(unsigned Amt) {
APSInt operator>>(unsigned Amt) const {
return IsUnsigned ? lshr(Amt) : ashr(Amt);
}