Remove custom implementations of max/min in StringRef that was originally added to...
[oota-llvm.git] / include / llvm / ADT / APSInt.h
index ad035a7c30df477c6c39e5f892ca0031f9911999..ee34e9b53088339b6057fc82094b98d8ef090581 100644 (file)
@@ -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;
   }
 
@@ -62,7 +56,7 @@ public:
     APInt::toString(Str, Radix, isSigned());
   }
   /// toString - Converts an APInt to a std::string.  This is an inefficient
-  /// method, your should prefer passing in a SmallString instead.
+  /// method; you should prefer passing in a SmallString instead.
   std::string toString(unsigned Radix) const {
     return APInt::toString(Radix, isSigned());
   }