[clang] [AST] Remove an unnecessary cast (NFC) (PR #151278)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 29 23:21:03 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
getSignificantBits() already returns unsigned.
---
Full diff: https://github.com/llvm/llvm-project/pull/151278.diff
1 Files Affected:
- (modified) clang/include/clang/AST/ASTContext.h (+1-1)
``````````diff
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 0273109f8a698..3b98274a80420 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -1818,7 +1818,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
NumPositiveBits = std::max({NumPositiveBits, ActiveBits, 1u});
} else {
NumNegativeBits =
- std::max(NumNegativeBits, (unsigned)InitVal.getSignificantBits());
+ std::max(NumNegativeBits, InitVal.getSignificantBits());
}
MembersRepresentableByInt &= isRepresentableIntegerValue(InitVal, IntTy);
``````````
</details>
https://github.com/llvm/llvm-project/pull/151278
More information about the cfe-commits
mailing list