[PATCH] D125559: [APInt] Remove truncOrSelf, zextOrSelf and sextOrSelf

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 09:12:04 PDT 2022


foad created this revision.
foad added reviewers: lattner, RKSimon, lebedev.ri, spatel.
Herald added a subscriber: hiraditya.
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/D125559

Files:
  llvm/include/llvm/ADT/APInt.h
  llvm/lib/Support/APInt.cpp


Index: llvm/lib/Support/APInt.cpp
===================================================================
--- llvm/lib/Support/APInt.cpp
+++ llvm/lib/Support/APInt.cpp
@@ -1007,24 +1007,6 @@
   return *this;
 }
 
-APInt APInt::truncOrSelf(unsigned width) const {
-  if (BitWidth > width)
-    return trunc(width);
-  return *this;
-}
-
-APInt APInt::zextOrSelf(unsigned width) const {
-  if (BitWidth < width)
-    return zext(width);
-  return *this;
-}
-
-APInt APInt::sextOrSelf(unsigned width) const {
-  if (BitWidth < width)
-    return sext(width);
-  return *this;
-}
-
 /// Arithmetic right-shift this APInt by shiftAmt.
 /// Arithmetic right-shift function.
 void APInt::ashrInPlace(const APInt &shiftAmt) {
Index: llvm/include/llvm/ADT/APInt.h
===================================================================
--- llvm/include/llvm/ADT/APInt.h
+++ llvm/include/llvm/ADT/APInt.h
@@ -1261,18 +1261,6 @@
   /// extended, truncated, or left alone to make it that width.
   APInt zextOrTrunc(unsigned width) const;
 
-  /// Truncate this APInt if necessary to ensure that its bit width is <= \p
-  /// width.
-  [[deprecated("Use trunc instead")]] APInt truncOrSelf(unsigned width) const;
-
-  /// Sign-extend this APInt if necessary to ensure that its bit width is >= \p
-  /// width.
-  [[deprecated("Use sext instead")]] APInt sextOrSelf(unsigned width) const;
-
-  /// Zero-extend this APInt if necessary to ensure that its bit width is >= \p
-  /// width.
-  [[deprecated("Use zext instead")]] APInt zextOrSelf(unsigned width) const;
-
   /// @}
   /// \name Bit Manipulation Operators
   /// @{


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125559.429267.patch
Type: text/x-patch
Size: 1605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220513/36407167/attachment.bin>


More information about the llvm-commits mailing list