summaryrefslogtreecommitdiff
path: root/lib/Support
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-06-21 22:03:12 +0000
committerDan Gohman <gohman@apple.com>2008-06-21 22:03:12 +0000
commit95df6b3603e228cea714be21997fec82cb03011e (patch)
tree70aa0d8c728697e9b3fdbfdd5503067041f9f739 /lib/Support
parent317adcc9c6b29fb491d615996ba70b5c415a9eb2 (diff)
downloadllvm-95df6b3603e228cea714be21997fec82cb03011e.tar.gz
llvm-95df6b3603e228cea714be21997fec82cb03011e.tar.bz2
llvm-95df6b3603e228cea714be21997fec82cb03011e.tar.xz
Avoid creating a redundant zero APInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index e13011faea..38b379005a 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -2048,7 +2048,7 @@ std::string APInt::toString(uint8_t radix, bool wantSigned) const {
result = "-";
insert_at = 1;
}
- if (tmp == APInt(tmp.getBitWidth(), 0))
+ if (tmp == zero)
result = "0";
else while (tmp.ne(zero)) {
APInt APdigit(1,0);