From: Craig Topper Date: Mon, 8 May 2017 04:55:12 +0000 (+0000) Subject: [APInt] Take advantage of new operator*=(uint64_t) to remove a temporary APInt. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b33f45017e93f5c2ec06b22faa861e250352f7aa;p=llvm [APInt] Take advantage of new operator*=(uint64_t) to remove a temporary APInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302403 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index e2cfb90d9e2..a337b5f8727 100644 --- a/lib/Support/APInt.cpp +++ b/lib/Support/APInt.cpp @@ -1842,10 +1842,6 @@ void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) { // Figure out if we can shift instead of multiply unsigned shift = (radix == 16 ? 4 : radix == 8 ? 3 : radix == 2 ? 1 : 0); - // Set up an APInt for the radix multiplier outside the loop so we don't - // constantly construct/destruct it. - APInt apradix(getBitWidth(), radix); - // Enter digit traversal loop for (StringRef::iterator e = str.end(); p != e; ++p) { unsigned digit = getDigit(*p, radix); @@ -1856,7 +1852,7 @@ void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) { if (shift) *this <<= shift; else - *this *= apradix; + *this *= radix; } // Add in the digit we just interpreted