[clang] [llvm] remove redundant uses of `isa` caught by clang-tidy (NFC) (PR #192813)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 20 03:32:15 PDT 2026
================
@@ -325,49 +325,47 @@ std::optional<bool> isUncheckedPtr(const QualType T) {
std::optional<bool> isGetterOfSafePtr(const CXXMethodDecl *M) {
assert(M);
- if (isa<CXXMethodDecl>(M)) {
- const CXXRecordDecl *calleeMethodsClass = M->getParent();
- auto className = safeGetName(calleeMethodsClass);
- auto method = safeGetName(M);
+ const CXXRecordDecl *calleeMethodsClass = M->getParent();
+ auto className = safeGetName(calleeMethodsClass);
+ auto method = safeGetName(M);
- if (isCheckedPtr(className) && (method == "get" || method == "ptr"))
- return true;
+ if (isCheckedPtr(className) && (method == "get" || method == "ptr"))
+ return true;
- if ((isRefType(className) && (method == "get" || method == "ptr")) ||
- ((className == "String" || className == "AtomString" ||
- className == "AtomStringImpl" || className == "UniqueString" ||
- className == "UniqueStringImpl" || className == "Identifier") &&
- method == "impl"))
- return true;
+ if ((isRefType(className) && (method == "get" || method == "ptr")) ||
+ ((className == "String" || className == "AtomString" ||
+ className == "AtomStringImpl" || className == "UniqueString" ||
+ className == "UniqueStringImpl" || className == "Identifier") &&
+ method == "impl"))
+ return true;
----------------
steakhal wrote:
While I agree that overall we should strive for excellence. The webkit checkers are already in a pretty rough shape. Personally, I wouldn't overinvest there. The webkit checkers only serve a fraction of the users of the static analyzer users.
https://github.com/llvm/llvm-project/pull/192813
More information about the cfe-commits
mailing list