[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas

2021-01-29 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Since the 12 branch has been cut, I've added a blocking bug to get this fixed in some form: https://bugs.llvm.org/show_bug.cgi?id=48935 @rsmith I've assigned it to you to make a call about whether to cherrypick this patch, this patch+followup, or revert the original c

[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas

2021-01-28 Thread Stephen Kelly via Phabricator via cfe-commits
steveire added inline comments. Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2063-2065 + if (const auto *MD = dyn_cast(D)) { +if (const CXXRecordDecl *RD = MD->getParent()) { + if (RD->isLambda()) { rsmith wrote: > This is incorrectly skipp

[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas

2021-01-28 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2063-2065 + if (const auto *MD = dyn_cast(D)) { +if (const CXXRecordDecl *RD = MD->getParent()) { + if (RD->isLambda()) { This is incorrectly skipping the bodies of

[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas

2021-01-28 Thread Stephen Kelly via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6f0df3cddb3e: [ASTMatchers] Avoid pathological traversal over nested lambdas (authored by stephenkelly). Changed prior to commit: https://reviews.

[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas

2021-01-28 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Thanks for the prompt fix, btw! Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:2064 + if (const auto *MD = dyn_cast(D)) { +if (const auto *RD = MD->getParent()) { + if (RD->isLambda()) { Please specify the type expli

[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas

2021-01-28 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. This fixes the issue with exponential traversal times for deeply nested lambdas. Please add a test though. For example, this one: void f() { [] { [] { [] { [] { [] {

[PATCH] D95573: [ASTMatchers] Avoid pathological traversal over nested lambdas

2021-01-27 Thread Stephen Kelly via Phabricator via cfe-commits
steveire created this revision. steveire added a reviewer: aaron.ballman. steveire requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D95573 Files: clang/include/clang/AST/Recu