Replace (Lower|Upper)caseString in favor of StringRef's newest methods.
[oota-llvm.git] / lib / Support / APInt.cpp
index 931c885b9268f5b65da187775869619d8ed74689..3774c5223c46db0fed27461a0e6c2dbf59158afa 100644 (file)
@@ -54,11 +54,11 @@ inline static unsigned getDigit(char cdigit, uint8_t radix) {
       return r;
 
     r = cdigit - 'A';
-    if (r <= unsigned(radix - 11U))
+    if (r <= radix - 11U)
       return r + 10;
 
     r = cdigit - 'a';
-    if (r <= unsigned(radix - 11U))
+    if (r <= radix - 11U)
       return r + 10;
     
     radix = 10;
@@ -386,6 +386,7 @@ APInt& APInt::operator*=(const APInt& RHS) {
   clearAllBits();
   unsigned wordsToCopy = destWords >= getNumWords() ? getNumWords() : destWords;
   memcpy(pVal, dest, wordsToCopy * APINT_WORD_SIZE);
+  clearUnusedBits();
 
   // delete dest array and return
   delete[] dest;
@@ -471,7 +472,7 @@ APInt APInt::operator*(const APInt& RHS) const {
     return APInt(BitWidth, VAL * RHS.VAL);
   APInt Result(*this);
   Result *= RHS;
-  return Result.clearUnusedBits();
+  return Result;
 }
 
 APInt APInt::operator+(const APInt& RHS) const {