diff options
Diffstat (limited to 'include/llvm/ADT/APSInt.h')
-rw-r--r-- | include/llvm/ADT/APSInt.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/include/llvm/ADT/APSInt.h b/include/llvm/ADT/APSInt.h index ad035a7c30..053defff52 100644 --- a/include/llvm/ADT/APSInt.h +++ b/include/llvm/ADT/APSInt.h @@ -30,18 +30,12 @@ public: explicit APSInt(uint32_t BitWidth, bool isUnsigned = true) : APInt(BitWidth, 0), IsUnsigned(isUnsigned) {} - explicit APSInt(const APInt &I, bool isUnsigned = true) - : APInt(I), IsUnsigned(isUnsigned) {} + explicit APSInt(APInt I, bool isUnsigned = true) + : APInt(std::move(I)), IsUnsigned(isUnsigned) {} - APSInt &operator=(const APSInt &RHS) { - APInt::operator=(RHS); - IsUnsigned = RHS.IsUnsigned; - return *this; - } - - APSInt &operator=(const APInt &RHS) { + APSInt &operator=(APInt RHS) { // Retain our current sign. - APInt::operator=(RHS); + APInt::operator=(std::move(RHS)); return *this; } |