Use the default parameters of countTrailingZeros and find{First,Last}Set (NFC)
authorKazu Hirata <kazu@google.com>
Sun, 15 Jan 2023 17:04:57 +0000 (09:04 -0800)
committerKazu Hirata <kazu@google.com>
Sun, 15 Jan 2023 17:04:57 +0000 (09:04 -0800)
This patch uses the default parameters of countTrailingZeros,
findFirstSet, and findLastSet, which are ZB_Width, ZB_Max, and ZB_Max,
respectively.

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

index 822ac7b..b82ead9 100644 (file)
@@ -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
index 3351c91..3b89b01 100644 (file)
@@ -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