summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit15084f085d064af2b1d98a006ca3a4d02b30c436 (patch)
treef53dc3197cf9e7e457f7cc23f9c84fcdeba0f89a /llvm/lib/Support/APInt.cpp
parentef62f57d4ff67888d553ec42a3cfd26212448a1d (diff)
downloadbcm5719-llvm-15084f085d064af2b1d98a006ca3a4d02b30c436.tar.gz
bcm5719-llvm-15084f085d064af2b1d98a006ca3a4d02b30c436.zip
PR5207: Make APInt::set(), APInt::clear() and APInt::flip() return void.
llvm-svn: 120413
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 6bbe9ab4632..4c2254e0325 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud