mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-08 04:51:23 +00:00
Revert r300811 "[APInt] Add back the asserts that check that the APInt shift methods aren't called with values larger than BitWidth."
This is failing a self host debug build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
be583f25e0
commit
b3443b3378
@ -847,9 +847,8 @@ public:
|
||||
///
|
||||
/// \returns *this after shifting left by ShiftAmt
|
||||
APInt &operator<<=(unsigned ShiftAmt) {
|
||||
assert(ShiftAmt <= BitWidth && "Invalid shift amount");
|
||||
if (isSingleWord()) {
|
||||
if (ShiftAmt == BitWidth)
|
||||
if (ShiftAmt >= BitWidth)
|
||||
VAL = 0;
|
||||
else
|
||||
VAL <<= ShiftAmt;
|
||||
@ -894,9 +893,8 @@ public:
|
||||
|
||||
/// Logical right-shift this APInt by ShiftAmt in place.
|
||||
void lshrInPlace(unsigned ShiftAmt) {
|
||||
assert(ShiftAmt <= BitWidth && "Invalid shift amount");
|
||||
if (isSingleWord()) {
|
||||
if (ShiftAmt == BitWidth)
|
||||
if (ShiftAmt >= BitWidth)
|
||||
VAL = 0;
|
||||
else
|
||||
VAL >>= ShiftAmt;
|
||||
|
@ -2021,7 +2021,7 @@ TEST(APIntTest, LogicalRightShift) {
|
||||
|
||||
// Ensure we handle large shifts of multi-word.
|
||||
const APInt neg_one(128, static_cast<uint64_t>(-1), true);
|
||||
EXPECT_EQ(0, neg_one.lshr(128));
|
||||
EXPECT_EQ(0, neg_one.lshr(257));
|
||||
}
|
||||
|
||||
TEST(APIntTest, LeftShift) {
|
||||
@ -2054,7 +2054,7 @@ TEST(APIntTest, LeftShift) {
|
||||
|
||||
// Ensure we handle large shifts of multi-word.
|
||||
const APInt neg_one(128, static_cast<uint64_t>(-1), true);
|
||||
EXPECT_EQ(0, neg_one.shl(128));
|
||||
EXPECT_EQ(0, neg_one.shl(257));
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
Loading…
Reference in New Issue
Block a user