From 7e629e4e888262abd8f076512b252208acd72d62 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 25 Jan 2023 22:59:51 -0800 Subject: [PATCH] [AST] Use llvm::bit_width (NFC) --- clang/lib/AST/Type.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index a713d6e3bd03..206cf6ee09d2 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -158,7 +158,7 @@ unsigned ConstantArrayType::getNumAddressingBits(const ASTContext &Context, if ((ElementSize >> 32) == 0 && NumElements.getBitWidth() <= 64 && (NumElements.getZExtValue() >> 32) == 0) { uint64_t TotalSize = NumElements.getZExtValue() * ElementSize; - return 64 - llvm::countLeadingZeros(TotalSize); + return llvm::bit_width(TotalSize); } // Otherwise, use APSInt to handle arbitrary sized values. -- 2.34.1