rjmccall added inline comments.
================ Comment at: include/clang/AST/DeclBase.h:1798 + /// innermost enclosing BlockDecl or null if there are no enclosing blocks. + const BlockDecl *getInnerMostBlockDecl() const { + const DeclContext *Ctx = this; ---------------- "innermost" is one word, so this should be `getInnermostBlockDecl`. ================ Comment at: lib/Sema/SemaExpr.cpp:2580 + if (const BlockDecl *BD = CurContext->getInnerMostBlockDecl()) + if (!getDiagnostics().isIgnored(diag::warn_implicitly_retains_self, Loc)) + ImplicitlyRetainedSelfLocs.push_back({Loc, BD}); ---------------- ahatanak wrote: > rjmccall wrote: > > IIRC this check can be expensive enough that it's probably not worth doing > > if you expect these entries to typically not result in diagnostics. > `DiagStateMap::lookup` is doing a binary search. Is that what makes this > check expensive? Yeah. It's not immensely expensive, but adding some entries to a vector in the fast path and then processing them later probably makes more sense. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60736/new/ https://reviews.llvm.org/D60736 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits