[llvm] 462b290 - [APInt] Deprecate several functions

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 5 22:48:35 PST 2023


Author: Kazu Hirata
Date: 2023-03-05T22:48:28-08:00
New Revision: 462b29019b20cf7b25c68ec952b1f92930f5035d

URL: https://github.com/llvm/llvm-project/commit/462b29019b20cf7b25c68ec952b1f92930f5035d
DIFF: https://github.com/llvm/llvm-project/commit/462b29019b20cf7b25c68ec952b1f92930f5035d.diff

LOG: [APInt] Deprecate several functions

This patch deprecates:

- those functions that have been soft-deprecated
- countPopulation

Note that I've already migrated away from all known uses of these
functions.

Differential Revision: https://reviews.llvm.org/D144423

Added: 
    

Modified: 
    llvm/include/llvm/ADT/APInt.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/APInt.h b/llvm/include/llvm/ADT/APInt.h
index 61c878608b5b..0357165b647a 100644
--- a/llvm/include/llvm/ADT/APInt.h
+++ b/llvm/include/llvm/ADT/APInt.h
@@ -176,7 +176,7 @@ class [[nodiscard]] APInt {
   /// Get the '0' value for the specified bit-width.
   static APInt getZero(unsigned numBits) { return APInt(numBits, 0); }
 
-  /// NOTE: This is soft-deprecated.  Please use `getZero()` instead.
+  LLVM_DEPRECATED("use getZero instead", "getZero")
   static APInt getNullValue(unsigned numBits) { return getZero(numBits); }
 
   /// Return an APInt zero bits wide.
@@ -215,7 +215,7 @@ class [[nodiscard]] APInt {
     return APInt(numBits, WORDTYPE_MAX, true);
   }
 
-  /// NOTE: This is soft-deprecated.  Please use `getAllOnes()` instead.
+  LLVM_DEPRECATED("use getAllOnes instead", "getAllOnes")
   static APInt getAllOnesValue(unsigned numBits) { return getAllOnes(numBits); }
 
   /// Return an APInt with exactly one bit set in the result.
@@ -359,7 +359,7 @@ class [[nodiscard]] APInt {
     return countTrailingOnesSlowCase() == BitWidth;
   }
 
-  /// NOTE: This is soft-deprecated.  Please use `isAllOnes()` instead.
+  LLVM_DEPRECATED("use isAllOnes instead", "isAllOnes")
   bool isAllOnesValue() const { return isAllOnes(); }
 
   /// Determine if this value is zero, i.e. all bits are clear.
@@ -369,7 +369,7 @@ class [[nodiscard]] APInt {
     return countLeadingZerosSlowCase() == BitWidth;
   }
 
-  /// NOTE: This is soft-deprecated.  Please use `isZero()` instead.
+  LLVM_DEPRECATED("use isZero instead", "isZero")
   bool isNullValue() const { return isZero(); }
 
   /// Determine if this is a value of 1.
@@ -381,7 +381,7 @@ class [[nodiscard]] APInt {
     return countLeadingZerosSlowCase() == BitWidth - 1;
   }
 
-  /// NOTE: This is soft-deprecated.  Please use `isOne()` instead.
+  LLVM_DEPRECATED("use isOne instead", "isOne")
   bool isOneValue() const { return isOne(); }
 
   /// Determine if this is the largest unsigned value.
@@ -1483,7 +1483,7 @@ class [[nodiscard]] APInt {
     return BitWidth - getNumSignBits() + 1;
   }
 
-  /// NOTE: This is soft-deprecated.  Please use `getSignificantBits()` instead.
+  LLVM_DEPRECATED("use getSignificantBits instead", "getSignificantBits")
   unsigned getMinSignedBits() const { return getSignificantBits(); }
 
   /// Get zero extended value
@@ -1584,7 +1584,7 @@ class [[nodiscard]] APInt {
 
   /// Count the number of trailing zero bits.
   ///
-  /// This function is an APInt version of the countr_zero. It counts the number
+  /// This function is an APInt version of std::countr_zero. It counts the number
   /// of zeros from the least significant bit to the first set bit.
   ///
   /// \returns BitWidth if the value is zero, otherwise returns the number of
@@ -1626,6 +1626,7 @@ class [[nodiscard]] APInt {
     return countPopulationSlowCase();
   }
 
+  LLVM_DEPRECATED("use popcount instead", "popcount")
   unsigned countPopulation() const { return popcount(); }
 
   /// @}


        


More information about the llvm-commits mailing list