diff options
| author | Craig Topper <craig.topper@gmail.com> | 2017-04-23 05:18:31 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2017-04-23 05:18:31 +0000 |
| commit | 5f68af08066b28be2cb12befe0067cbafa0f8ac2 (patch) | |
| tree | 0fda37a49bd5b6de24c590fa89556cf758394594 /llvm/lib/Support/APInt.cpp | |
| parent | 5da709025629fcc90a37cfd942632c98a3c4de94 (diff) | |
| download | bcm5719-llvm-5f68af08066b28be2cb12befe0067cbafa0f8ac2.tar.gz bcm5719-llvm-5f68af08066b28be2cb12befe0067cbafa0f8ac2.zip | |
[APInt] Use operator<<= instead of shl where possible. NFC
llvm-svn: 301103
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
| -rw-r--r-- | llvm/lib/Support/APInt.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index c72e3bf9872..5f3358d1dcf 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 = Tmp.shl((unsigned)exp - 52); + Tmp <<= (unsigned)exp - 52; return isNeg ? -Tmp : Tmp; } @@ -1081,9 +1081,10 @@ void APInt::lshrSlowCase(unsigned ShiftAmt) { /// Left-shift this APInt by shiftAmt. /// @brief Left-shift function. -APInt APInt::shl(const APInt &shiftAmt) const { +APInt &APInt::operator<<=(const APInt &shiftAmt) { // It's undefined behavior in C to shift by BitWidth or greater. - return shl((unsigned)shiftAmt.getLimitedValue(BitWidth)); + *this <<= (unsigned)shiftAmt.getLimitedValue(BitWidth); + return *this; } void APInt::shlSlowCase(unsigned ShiftAmt) { |

