diff options
author | Jakub Staszak <kubastaszak@gmail.com> | 2013-03-20 23:56:19 +0000 |
---|---|---|
committer | Jakub Staszak <kubastaszak@gmail.com> | 2013-03-20 23:56:19 +0000 |
commit | 773be0ce1fb04212cdf7a46be3eb7e4bc5ffe95c (patch) | |
tree | db5984de056a1c0f97e59a45e285b144ac9e17b5 /llvm/lib/Support/APInt.cpp | |
parent | fa41def6ce4d6f57f0588e1636751b2fe4181215 (diff) | |
download | llvm-773be0ce1fb04212cdf7a46be3eb7e4bc5ffe95c.zip llvm-773be0ce1fb04212cdf7a46be3eb7e4bc5ffe95c.tar.gz llvm-773be0ce1fb04212cdf7a46be3eb7e4bc5ffe95c.tar.bz2 |
Use pre-inc, pre-dec when possible.
They are generally faster (at least not slower) than post-inc, post-dec.
llvm-svn: 177608
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 07cb057..e853475 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -559,12 +559,12 @@ bool APInt::slt(const APInt& RHS) const { if (lhsNeg) { // Sign bit is set so perform two's complement to make it positive lhs.flipAllBits(); - lhs++; + ++lhs; } if (rhsNeg) { // Sign bit is set so perform two's complement to make it positive rhs.flipAllBits(); - rhs++; + ++rhs; } // Now we have unsigned values to compare so do the comparison if necessary @@ -2116,7 +2116,7 @@ void APInt::fromString(unsigned numbits, StringRef str, uint8_t radix) { } // If its negative, put it in two's complement form if (isNeg) { - (*this)--; + --(*this); this->flipAllBits(); } } @@ -2197,7 +2197,7 @@ void APInt::toString(SmallVectorImpl<char> &Str, unsigned Radix, // Flip the bits and add one to turn it into the equivalent positive // value and put a '-' in the result. Tmp.flipAllBits(); - Tmp++; + ++Tmp; Str.push_back('-'); } |