llvm.org GIT mirror llvm / e8b9699
[APSInt] Make use of APInt's recently acquired in place lshr and shl capabilities in APSInt's >>= and <<= operators. APInt hasn't acquired an in place ashr yet, but hopefully soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301052 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 3 years ago
1 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
124124 return IsUnsigned ? APSInt(lshr(Amt), true) : APSInt(ashr(Amt), false);
125125 }
126126 APSInt& operator>>=(unsigned Amt) {
127 *this = *this >> Amt;
127 if (IsUnsigned)
128 lshrInPlace(Amt);
129 else
130 *this = *this >> Amt;
128131 return *this;
129132 }
130133
178181 return APSInt(static_cast(*this) << Bits, IsUnsigned);
179182 }
180183 APSInt& operator<<=(unsigned Amt) {
181 *this = *this << Amt;
184 static_cast(*this) <<= Amt;
182185 return *this;
183186 }
184187