[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 07:52:34 PDT 2024
================
@@ -302,7 +302,7 @@ void MangleContext::mangleBlock(const DeclContext *DC, const BlockDecl *BD,
assert((isa<NamedDecl>(DC) || isa<BlockDecl>(DC)) &&
"expected a NamedDecl or BlockDecl");
if (isa<BlockDecl>(DC))
- for (; DC && isa<BlockDecl>(DC); DC = DC->getParent())
+ for (; isa_and_nonnull<BlockDecl>(DC); DC = DC->getParent())
(void) getBlockId(cast<BlockDecl>(DC), true);
----------------
NagyDonat wrote:
Could you remove the line `if (isa<BlockDecl>(DC))` as well? It's completely redundant with the loop condition.
Although I see that this is a big automatic change, so perhaps it should be left for a separate change.
https://github.com/llvm/llvm-project/pull/94987
More information about the cfe-commits
mailing list