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
> `MatchFinder::matchAST`, which will start the traverse from the
> TranslationUnitDecl.
> And there is no option to pick a specific node and specify that as the
> root of the traverse. I'd like an option to be able to start the traverse
> from a specific node, if it makes sense.
>

MatchFinder::match allows you to match a node. Wrapping your matcher code
with:
auto m = <my cool matcher>;
ast_matchers::match(anyOf(m, hashDescendant(m)), node, context);
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to