[llvm] 4e432f1 - [APInt] Deprecate truncOrSelf, zextOrSelf and sextOrSelf
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu May 19 03:33:26 PDT 2022
Author: Jay Foad
Date: 2022-05-19T11:23:13+01:00
New Revision: 4e432f1b7ce6af4b24e67ebd21d119b092427a03
URL: https://github.com/llvm/llvm-project/commit/4e432f1b7ce6af4b24e67ebd21d119b092427a03
DIFF: https://github.com/llvm/llvm-project/commit/4e432f1b7ce6af4b24e67ebd21d119b092427a03.diff
LOG: [APInt] Deprecate truncOrSelf, zextOrSelf and sextOrSelf
Differential Revision: https://reviews.llvm.org/D125558
Added:
Modified:
llvm/include/llvm/ADT/APInt.h
llvm/unittests/ADT/APIntTest.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index 3c75417872f5b..45d32e1c1e495 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -1263,15 +1263,15 @@ class LLVM_NODISCARD APInt {
/// 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
index aca4a9ade8ff6..607560aa7e019 100644
--- a/llvm/unittests/ADT/APIntTest.cpp
+++ b/llvm/unittests/ADT/APIntTest.cpp
@@ -2663,9 +2663,6 @@ TEST(APIntTest, trunc) {
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) {
More information about the llvm-commits
mailing list