diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-05-08 04:55:12 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-05-08 04:55:12 +0000 |
commit | f15bec554147ad9e2fc2b255305d68694550ba3e (patch) | |
tree | 8f1262618ca4a7dcfc30c11c668e9e57e212977a /llvm/lib/Support/APInt.cpp | |
parent | a51941f3140cf0ed5c79bf828ff3e418fc5df71d (diff) | |
download | bcm5719-llvm-f15bec554147ad9e2fc2b255305d68694550ba3e.tar.gz bcm5719-llvm-f15bec554147ad9e2fc2b255305d68694550ba3e.zip |
[APInt] Take advantage of new operator*=(uint64_t) to remove a temporary APInt.
llvm-svn: 302403
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index e2cfb90d9e2..a337b5f8727 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/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 |