[Lldb-commits] [lldb] 9ce7b40 - Use the default parameters of countTrailingZeros and find{First, Last}Set (NFC)

Kazu Hirata via lldb-commits lldb-commits at lists.llvm.org
Sun Jan 15 09:05:04 PST 2023


Author: Kazu Hirata
Date: 2023-01-15T09:04:57-08:00
New Revision: 9ce7b40ad49f4e16c74d0a181c5cd25d21e417c8

URL: https://github.com/llvm/llvm-project/commit/9ce7b40ad49f4e16c74d0a181c5cd25d21e417c8
DIFF: https://github.com/llvm/llvm-project/commit/9ce7b40ad49f4e16c74d0a181c5cd25d21e417c8.diff

LOG: Use the default parameters of countTrailingZeros and find{First,Last}Set (NFC)

This patch uses the default parameters of countTrailingZeros,
findFirstSet, and findLastSet, which are ZB_Width, ZB_Max, and ZB_Max,
respectively.

Added: 
    

Modified: 
    lldb/source/Symbol/CompactUnwindInfo.cpp
    llvm/lib/Support/APInt.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Symbol/CompactUnwindInfo.cpp b/lldb/source/Symbol/CompactUnwindInfo.cpp
index 822ac7b8fbe90..b82ead94faa1a 100644
--- a/lldb/source/Symbol/CompactUnwindInfo.cpp
+++ b/lldb/source/Symbol/CompactUnwindInfo.cpp
@@ -155,8 +155,7 @@ FLAGS_ANONYMOUS_ENUM(){
 #endif
 
 #define EXTRACT_BITS(value, mask)                                              \
-  ((value >>                                                                   \
-    llvm::countTrailingZeros(static_cast<uint32_t>(mask), llvm::ZB_Width)) &   \
+  ((value >> llvm::countTrailingZeros(static_cast<uint32_t>(mask))) &          \
    (((1 << llvm::countPopulation(static_cast<uint32_t>(mask)))) - 1))
 
 // constructor

diff  --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 3351c9127ee27..3b89b01f1dfd5 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -2293,13 +2293,13 @@ static inline APInt::WordType highHalf(APInt::WordType part) {
 /// Returns the bit number of the most significant set bit of a part.
 /// If the input number has no bits set -1U is returned.
 static unsigned partMSB(APInt::WordType value) {
-  return findLastSet(value, ZB_Max);
+  return findLastSet(value);
 }
 
 /// Returns the bit number of the least significant set bit of a part.  If the
 /// input number has no bits set -1U is returned.
 static unsigned partLSB(APInt::WordType value) {
-  return findFirstSet(value, ZB_Max);
+  return findFirstSet(value);
 }
 
 /// Sets the least significant part of a bignum to the input value, and zeroes


        


More information about the lldb-commits mailing list