[PATCH] D125558: [APInt] Deprecate truncOrSelf, zextOrSelf and sextOrSelf
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri May 13 09:11:55 PDT 2022
foad created this revision.
foad added reviewers: lattner, RKSimon, lebedev.ri, spatel.
Herald added a project: All.
foad requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D125558
Files:
llvm/include/llvm/ADT/APInt.h
llvm/unittests/ADT/APIntTest.cpp
Index: llvm/unittests/ADT/APIntTest.cpp
===================================================================
--- llvm/unittests/ADT/APIntTest.cpp
+++ 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) {
Index: llvm/include/llvm/ADT/APInt.h
===================================================================
--- llvm/include/llvm/ADT/APInt.h
+++ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125558.429266.patch
Type: text/x-patch
Size: 1384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220513/4d19002b/attachment.bin>
More information about the llvm-commits
mailing list