aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorJakub Staszak <kubastaszak@gmail.com>2013-03-20 23:56:19 +0000
committerJakub Staszak <kubastaszak@gmail.com>2013-03-20 23:56:19 +0000
commit2adf8ccbf0611df6393c30737d87faaf38cdcd0c (patch)
tree3b9e4091947c3e189d5e1dace806eaa49030c36d /lib/Support/APInt.cpp
parent7f19e5db5f4f730f72c248282b7c00e6cdaf6782 (diff)
downloadexternal_llvm-2adf8ccbf0611df6393c30737d87faaf38cdcd0c.zip
external_llvm-2adf8ccbf0611df6393c30737d87faaf38cdcd0c.tar.gz
external_llvm-2adf8ccbf0611df6393c30737d87faaf38cdcd0c.tar.bz2
Use pre-inc, pre-dec when possible.
They are generally faster (at least not slower) than post-inc, post-dec. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177608 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 07cb057..e853475 100644
--- a/lib/Support/APInt.cpp
+++ b/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('-');
}