diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-08-13 00:29:44 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-08-13 00:29:44 +0000 |
| commit | 2df195eea14c50bd01d37d6ae10382d231af7eb0 (patch) | |
| tree | 446512db1e4646b88c2a57329711e5a2fb80c313 | |
| parent | b269b6eabb081658f3eebdd09672cf2cc1e8c661 (diff) | |
| download | bcm5719-llvm-2df195eea14c50bd01d37d6ae10382d231af7eb0.tar.gz bcm5719-llvm-2df195eea14c50bd01d37d6ae10382d231af7eb0.zip | |
Use getAllOnesValue, saves a copy and looks better.
llvm-svn: 110991
| -rw-r--r-- | llvm/include/llvm/ADT/APInt.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h index 59e023b05ab..8004cb4b123 100644 --- a/llvm/include/llvm/ADT/APInt.h +++ b/llvm/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. |

