diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-04-30 07:45:01 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-04-30 07:45:01 +0000 |
commit | 7f7d12003ab888568152a3b550df441341c2fa27 (patch) | |
tree | 8dccae4fc23001e46e3b45da377b2e5700edf6e3 /llvm/unittests/ADT/APIntTest.cpp | |
parent | 778f57b4f1476b7f9c51e18948ad51e6ce19ddef (diff) | |
download | bcm5719-llvm-7f7d12003ab888568152a3b550df441341c2fa27.tar.gz bcm5719-llvm-7f7d12003ab888568152a3b550df441341c2fa27.zip |
[APInt] Remove support for wrapping from APInt::setBits.
This features isn't used anywhere in tree. It's existence seems to be preventing selfhost builds from inlining any of the setBits methods including setLowBits, setHighBits, and setBitsFrom. This is because the code makes the method recursive.
If anyone needs this feature in the future we could consider adding a setBitsWithWrap method. This way only the calls that need it would pay for it.
llvm-svn: 301769
Diffstat (limited to 'llvm/unittests/ADT/APIntTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/APIntTest.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp index 2235f271658..bb6cf35fe9e 100644 --- a/llvm/unittests/ADT/APIntTest.cpp +++ b/llvm/unittests/ADT/APIntTest.cpp @@ -1723,21 +1723,21 @@ TEST(APIntTest, getLowBitsSet) { } TEST(APIntTest, getBitsSet) { - APInt i64hi1lo1 = APInt::getBitsSet(64, 63, 1); - EXPECT_EQ(1u, i64hi1lo1.countLeadingOnes()); - EXPECT_EQ(0u, i64hi1lo1.countLeadingZeros()); - EXPECT_EQ(64u, i64hi1lo1.getActiveBits()); - EXPECT_EQ(0u, i64hi1lo1.countTrailingZeros()); - EXPECT_EQ(1u, i64hi1lo1.countTrailingOnes()); - EXPECT_EQ(2u, i64hi1lo1.countPopulation()); - - APInt i127hi1lo1 = APInt::getBitsSet(127, 126, 1); - EXPECT_EQ(1u, i127hi1lo1.countLeadingOnes()); - EXPECT_EQ(0u, i127hi1lo1.countLeadingZeros()); - EXPECT_EQ(127u, i127hi1lo1.getActiveBits()); - EXPECT_EQ(0u, i127hi1lo1.countTrailingZeros()); - EXPECT_EQ(1u, i127hi1lo1.countTrailingOnes()); - EXPECT_EQ(2u, i127hi1lo1.countPopulation()); + APInt i64hi1lo1 = APInt::getBitsSet(64, 1, 63); + EXPECT_EQ(0u, i64hi1lo1.countLeadingOnes()); + EXPECT_EQ(1u, i64hi1lo1.countLeadingZeros()); + EXPECT_EQ(63u, i64hi1lo1.getActiveBits()); + EXPECT_EQ(1u, i64hi1lo1.countTrailingZeros()); + EXPECT_EQ(0u, i64hi1lo1.countTrailingOnes()); + EXPECT_EQ(62u, i64hi1lo1.countPopulation()); + + APInt i127hi1lo1 = APInt::getBitsSet(127, 1, 126); + EXPECT_EQ(0u, i127hi1lo1.countLeadingOnes()); + EXPECT_EQ(1u, i127hi1lo1.countLeadingZeros()); + EXPECT_EQ(126u, i127hi1lo1.getActiveBits()); + EXPECT_EQ(1u, i127hi1lo1.countTrailingZeros()); + EXPECT_EQ(0u, i127hi1lo1.countTrailingOnes()); + EXPECT_EQ(125u, i127hi1lo1.countPopulation()); } TEST(APIntTest, getHighBitsSet) { |