[clang] [clang] Replace X && isa<Y>(X) with isa_and_nonnull<Y>(X). NFC (PR #94987)

Pavel Samolysov via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 10 10:09:00 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)))
----------------
samolisov wrote:

I agree and will return this change back to preserve the consistence.

https://github.com/llvm/llvm-project/pull/94987


More information about the cfe-commits mailing list