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 AST? > > Ok, I changed and wrapped the pattern: > > template <typename MatcherType> > NodeType *match(const Decl *D, const MatcherType &AMatcher) { > MatchFinder Finder; > auto WrappedMatcher = anyOf(AMatcher.bind(""), > hasDescendant(AMatcher.bind(""))); > Finder.addMatcher(WrappedMatcher, this); > // ... > } > If you know the node is a decl, wrapping it in decl() should be enough. Does this work? auto WrappedMatcher = decl(anyOf(...));
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits