diff options
author | Renato Golin <renato.golin@linaro.org> | 2017-04-23 12:15:30 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2017-04-23 12:15:30 +0000 |
commit | 4abfb3d7414e616cd84034735893528f6ca0c35a (patch) | |
tree | bae49d1d9a15f3a024d91fd1d2e177f41d8a3f32 /llvm/lib/Support/APInt.cpp | |
parent | cc4a9120f6944a48d1df4c676ee77af3904b4442 (diff) | |
download | llvm-4abfb3d7414e616cd84034735893528f6ca0c35a.zip llvm-4abfb3d7414e616cd84034735893528f6ca0c35a.tar.gz llvm-4abfb3d7414e616cd84034735893528f6ca0c35a.tar.bz2 |
Revert "[APInt] Fix a few places that use APInt::getRawData to operate within the normal API."
This reverts commit r301105, 4, 3 and 1, as a follow up of the previous
revert, which broke even more bots.
For reference:
Revert "[APInt] Use operator<<= where possible. NFC"
Revert "[APInt] Use operator<<= instead of shl where possible. NFC"
Revert "[APInt] Use ashInPlace where possible."
PR32754.
llvm-svn: 301111
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 1c697d3..9bb364a 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -844,7 +844,7 @@ APInt llvm::APIntOps::RoundDoubleToAPInt(double Double, unsigned width) { // Otherwise, we have to shift the mantissa bits up to the right location APInt Tmp(width, mantissa); - Tmp <<= (unsigned)exp - 52; + Tmp = Tmp.shl((unsigned)exp - 52); return isNeg ? -Tmp : Tmp; } @@ -1128,10 +1128,9 @@ void APInt::lshrSlowCase(unsigned ShiftAmt) { /// Left-shift this APInt by shiftAmt. /// @brief Left-shift function. -APInt &APInt::operator<<=(const APInt &shiftAmt) { +APInt APInt::shl(const APInt &shiftAmt) const { // It's undefined behavior in C to shift by BitWidth or greater. - *this <<= (unsigned)shiftAmt.getLimitedValue(BitWidth); - return *this; + return shl((unsigned)shiftAmt.getLimitedValue(BitWidth)); } void APInt::shlSlowCase(unsigned ShiftAmt) { |