[clang] [clang] Replace X && isa<Y>(X) with isa_and_nonnull<Y>(X). NFC (PR #94987)
    DonĂ¡t Nagy via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Jun 10 09:58:21 PDT 2024
    
    
  
================
@@ -8510,7 +8510,8 @@ class MappableExprsHandler {
         assert(VDecl == VD && "We got information for the wrong declaration??");
         assert(!Components.empty() &&
                "Not expecting declaration with no component lists.");
-        if (VD && E && VD->getType()->isAnyPointerType() && isa<DeclRefExpr>(E))
+        if (VD && VD->getType()->isAnyPointerType() &&
+            isa_and_nonnull<DeclRefExpr>(E))
           HasMapBasePtr = true;
         if (VD && E && VD->getType()->isAnyPointerType() &&
             (isa<ArraySectionExpr>(E) || isa<ArraySubscriptExpr>(E)))
----------------
NagyDonat wrote:
Consider preserving the analogy between this and the next `if` with two analogous `isa<>()` calls.
https://github.com/llvm/llvm-project/pull/94987
    
    
More information about the cfe-commits
mailing list