================ @@ -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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits