<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Thu, Jul 26, 2018 at 12:44 PM Gabor Marton via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">martong added a comment.<br>
<br>
> Usually we use match(anyOf(node), hasDescendant(node)). Or did I misunderstand what you want?<br>
<br>
My understanding is that, the free function template `match` uses `MatchFinder::matchAST`, which will start the traverse from the TranslationUnitDecl.<br>
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.<br></blockquote><div><br></div><div>MatchFinder::match allows you to match a node. Wrapping your matcher code with:</div><div>auto m = <my cool matcher>;</div><div>ast_matchers::match(anyOf(m, hashDescendant(m)), node, context);</div><div><br></div></div></div>