diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h --- a/llvm/include/llvm/ADT/APInt.h +++ b/llvm/include/llvm/ADT/APInt.h @@ -1263,15 +1263,15 @@ /// Truncate this APInt if necessary to ensure that its bit width is <= \p /// width. - APInt truncOrSelf(unsigned width) const; + [[deprecated("Use trunc instead")]] APInt truncOrSelf(unsigned width) const; /// Sign-extend this APInt if necessary to ensure that its bit width is >= \p /// width. - APInt sextOrSelf(unsigned width) const; + [[deprecated("Use sext instead")]] APInt sextOrSelf(unsigned width) const; /// Zero-extend this APInt if necessary to ensure that its bit width is >= \p /// width. - APInt zextOrSelf(unsigned width) const; + [[deprecated("Use zext instead")]] APInt zextOrSelf(unsigned width) const; /// @} /// \name Bit Manipulation Operators diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp --- a/llvm/unittests/ADT/APIntTest.cpp +++ b/llvm/unittests/ADT/APIntTest.cpp @@ -2663,9 +2663,6 @@ APInt val(32, 0xFFFFFFFF); EXPECT_EQ(0xFFFF, val.trunc(16)); EXPECT_EQ(0xFFFFFFFF, val.trunc(32)); - EXPECT_EQ(0xFFFF, val.truncOrSelf(16)); - EXPECT_EQ(0xFFFFFFFF, val.truncOrSelf(32)); - EXPECT_EQ(0xFFFFFFFF, val.truncOrSelf(64)); } TEST(APIntTest, concat) {