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
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 for not just `decl()` but other kind of nodes too.)
Could you please advise how to move on? Also, could
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?
>
>
>
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?
See http://lists.llvm.org/pipermail/cfe-dev/2018-July/058625.html for a bug
that prevents this working.
martong added a comment.
> If you know the node is a decl, wrapping it in decl() should be enough.
> Does this work?
> auto WrappedMatcher = decl(anyOf(...));
Unfortunately this gives again the private ctor error (the same error when I
called explicitly the overload with the
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
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 AST?
Ok, I changed and wrapped the pattern:
template
NodeType *match(const Decl *D, const
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);
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);
Okay, I understand and accept that.
However, I consider that a different level of abstraction.
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
>
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
`MatchFinder::matchAST`, which will start the traverse from the
TranslationUnitDecl.
And there is no
klimek added a comment.
Usually we use match(anyOf(node), hasDescendant(node)). Or did I misunderstand
what you want?
Repository:
rC Clang
https://reviews.llvm.org/D49840
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
martong created this revision.
martong added reviewers: klimek, aprantl, pcc, sbenza, Prazek, dblaikie,
balazske, xazax.hun.
Herald added subscribers: cfe-commits, dkrupp, rnkovacs.
Add matchSubtree, so we can traverse on a subtree rooted on a specific node.
Currently, we can match **one** node
13 matches
Mail list logo