[PATCH] D72414: Implement new AST matchers `hasAnyCapture` and `capturesThis`.These matchers match on LambdaExpr:hasAnyCapture - matches if any child VarDecl matcher matches one of the captured vars.c

2020-01-08 Thread Reid via Phabricator via cfe-commits
rhiro created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add new AST matchers `hasAnyCapture` and `capturesThis` as LambdaExpr matchers. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D72414 Files: clang/include/clang/ASTMatchers/AST

[PATCH] D72414: Add new AST matchers `hasAnyCapture` and `capturesThis`

2020-01-09 Thread Reid via Phabricator via cfe-commits
rhiro updated this revision to Diff 237195. rhiro added a comment. - Change the hasCaptureThis functionality to be an override of hasAnyCapture with cxxThisExpr argument. Also generate the documentation and update tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

[PATCH] D72414: Add new AST matchers `hasAnyCapture` and `capturesThis`

2020-01-09 Thread Reid via Phabricator via cfe-commits
rhiro marked an inline comment as done. rhiro added a comment. Thanks for the review! I regenerated the docs and switched the `this` capture case to be an override of `hasAnyCapture`. Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4056 +/// matches [this](){}; +A

[PATCH] D72414: Add new AST matcher `hasAnyCapture`

2020-01-10 Thread Reid via Phabricator via cfe-commits
rhiro updated this revision to Diff 237389. rhiro added a comment. Fixed the condition for the varDecl case and made the cxxThisExpr more concise. - Condition on `capturesVariable` instead of `capturesThis` and switch the loop in the cxxThisExpr overload to use llvm::any_of instead of an explici

[PATCH] D72414: Add new AST matcher `hasAnyCapture`

2020-01-10 Thread Reid via Phabricator via cfe-commits
rhiro marked 2 inline comments as done. rhiro added a comment. I addressed the inline comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72414/new/ https://reviews.llvm.org/D72414 ___ cfe-commits

[PATCH] D72414: Add new AST matcher `hasAnyCapture`

2020-01-10 Thread Reid via Phabricator via cfe-commits
rhiro added a comment. In D72414#1814831 , @aaron.ballman wrote: > LGTM! Do you need someone to commit on your behalf? Yes, please. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72414/new/ https://review