aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-08-13 00:29:44 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-08-13 00:29:44 +0000
commit452b93e7dc2802dea3a31ea12c397d11c3c5e23b (patch)
treedc4d9c3f68f614f85e87645b21fedc63f8bfefbb
parent7f1f4089a142e4f0081ac25699bf682a68247a35 (diff)
Use getAllOnesValue, saves a copy and looks better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110991 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ADT/APInt.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h
index 59e023b05a..8004cb4b12 100644
--- a/include/llvm/ADT/APInt.h
+++ b/include/llvm/ADT/APInt.h
@@ -464,7 +464,7 @@ public:
// For small values, return quickly
if (numBits <= APINT_BITS_PER_WORD)
return APInt(numBits, ~0ULL << shiftAmt);
- return (~APInt(numBits, 0)).shl(shiftAmt);
+ return getAllOnesValue(numBits).shl(shiftAmt);
}
/// Constructs an APInt value that has the bottom loBitsSet bits set.
@@ -481,7 +481,7 @@ public:
// For small values, return quickly.
if (numBits < APINT_BITS_PER_WORD)
return APInt(numBits, (1ULL << loBitsSet) - 1);
- return (~APInt(numBits, 0)).lshr(numBits - loBitsSet);
+ return getAllOnesValue(numBits).lshr(numBits - loBitsSet);
}
/// The hash value is computed as the sum of the words and the bit width.