From 4abfb3d7414e616cd84034735893528f6ca0c35a Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Sun, 23 Apr 2017 12:15:30 +0000 Subject: 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 --- llvm/lib/Support/APInt.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Support/APInt.cpp') 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) { -- cgit v1.1