Re: [PATCH] D49840: [AST] Add MatchFinder::matchSubtree

2018-08-27 Thread Manuel Klimek via cfe-commits
On Mon, Aug 6, 2018 at 4:47 PM Gabor Marton via Phabricator < revi...@reviews.llvm.org> wrote: > martong added a comment. > > Ping. > > Manuel, I still don't see how could we apply `match(anyOf(node), > hasDescendant(node))` to the problem of general subtree traversal. > (I'd like to have support

Re: [PATCH] D49840: [AST] Add MatchFinder::matchSubtree

2018-07-30 Thread Manuel Klimek via cfe-commits
On Mon, Jul 30, 2018 at 10:02 AM Stephen Kelly via Phabricator < revi...@reviews.llvm.org> wrote: > steveire added a comment. > > In https://reviews.llvm.org/D49840#1176405, @klimek wrote: > > > Usually we use match(anyOf(node), hasDescendant(node)). Or did I > misunderstand what you want? > > > S

Re: [PATCH] D49840: [AST] Add MatchFinder::matchSubtree

2018-07-27 Thread Manuel Klimek via cfe-commits
On Fri, Jul 27, 2018 at 12:43 PM Gabor Marton via Phabricator < revi...@reviews.llvm.org> wrote: > martong added a comment. > > > Finder.match also has an overload that takes the node. Can you wrap > "Pattern" above in the anyOf(hasDescendant(...), ...) and match on the node > instead of the full

Re: [PATCH] D49840: [AST] Add MatchFinder::matchSubtree

2018-07-27 Thread Manuel Klimek via cfe-commits
On Fri, Jul 27, 2018 at 10:39 AM Gabor Marton via Phabricator < revi...@reviews.llvm.org> wrote: > martong added a comment. > > > MatchFinder::match allows you to match a node. Wrapping your matcher > code with: > > auto m = ; > > ast_matchers::match(anyOf(m, hashDescendant(m)), node, context);

Re: [PATCH] D49840: [AST] Add MatchFinder::matchSubtree

2018-07-27 Thread Manuel Klimek via cfe-commits
On Thu, Jul 26, 2018 at 12:44 PM Gabor Marton via Phabricator < revi...@reviews.llvm.org> wrote: > martong added a comment. > > > Usually we use match(anyOf(node), hasDescendant(node)). Or did I > misunderstand what you want? > > My understanding is that, the free function template `match` uses >