erik.pilkington added a comment. Akira and I were just talking about an alternative approach to this: Keep a vector of pairs of BlockDecls and SourceLocations in the enclosing method's FunctionScopeInfo, and emit any unsuppressed diagnostics when popping the method. This would avoid having to traverse all the blocks in methods in ARC mode, at the cost of a small amount of memory.
================ Comment at: lib/Sema/Sema.cpp:1682-1687 + void VisitBlockDecl(const BlockDecl *BD) { + bool OldVisitingEscapingBlock = VisitingEscapingBlock; + VisitingEscapingBlock = VisitingEscapingBlock || !BD->doesNotEscape(); + Visit(BD->getBody()); + VisitingEscapingBlock = OldVisitingEscapingBlock; + } ---------------- Maybe call this "diagnoseBlockDecl" or something so it doesn't sounds like a CRTP-overridden method. 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