aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2010-11-30 09:02:01 +0000
committerJay Foad <jay.foad@gmail.com>2010-11-30 09:02:01 +0000
commita99793c5ea24dd3839f4925b89b1f6acfcb24604 (patch)
tree9afc172530d02af7cd75c095cf7b7fa095341182 /lib/Support/APInt.cpp
parentd872f144e2c9e19dacef9468eb0c953f9eb88bf9 (diff)
downloadexternal_llvm-a99793c5ea24dd3839f4925b89b1f6acfcb24604.zip
external_llvm-a99793c5ea24dd3839f4925b89b1f6acfcb24604.tar.gz
external_llvm-a99793c5ea24dd3839f4925b89b1f6acfcb24604.tar.bz2
PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120413 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 6bbe9ab..4c2254e 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -584,22 +584,20 @@ bool APInt::slt(const APInt& RHS) const {
return lhs.ult(rhs);
}
-APInt& APInt::set(unsigned bitPosition) {
+void APInt::set(unsigned bitPosition) {
if (isSingleWord())
VAL |= maskBit(bitPosition);
else
pVal[whichWord(bitPosition)] |= maskBit(bitPosition);
- return *this;
}
/// Set the given bit to 0 whose position is given as "bitPosition".
/// @brief Set a given bit to 0.
-APInt& APInt::clear(unsigned bitPosition) {
+void APInt::clear(unsigned bitPosition) {
if (isSingleWord())
VAL &= ~maskBit(bitPosition);
else
pVal[whichWord(bitPosition)] &= ~maskBit(bitPosition);
- return *this;
}
/// @brief Toggle every bit to its opposite value.
@@ -607,11 +605,10 @@ APInt& APInt::clear(unsigned bitPosition) {
/// Toggle a given bit to its opposite value whose position is given
/// as "bitPosition".
/// @brief Toggles a given bit to its opposite value.
-APInt& APInt::flip(unsigned bitPosition) {
+void APInt::flip(unsigned bitPosition) {
assert(bitPosition < BitWidth && "Out of the bit-width range!");
if ((*this)[bitPosition]) clear(bitPosition);
else set(bitPosition);
- return *this;
}
unsigned APInt::getBitsNeeded(StringRef str, uint8_t radix) {