1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

add missing methods, mark stuff const

llvm-svn: 35862
This commit is contained in:
Chris Lattner 2007-04-10 07:06:21 +00:00
parent da0e61ca4c
commit f661523670

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);
}