[PATCH] D19871: Add an AST matcher for CastExpr kind

Etienne Bergeron via cfe-commits cfe-commits at lists.llvm.org
Tue May 3 08:47:23 PDT 2016


etienneb added a comment.

> It's good to have that context in a review for functionality that isn't part of the proposed patch. :-) Looking at the other patch, I would prefer to keep this matcher narrowed to just clang-tidy unless you can also solve how to expose it via the dynamic registry so that it can be used by tools like clang-query.


That was my original idea.

In http://reviews.llvm.org/D19871#419998, @sbenza wrote:

> In http://reviews.llvm.org/D19871#419985, @aaron.ballman wrote:
>
> > In http://reviews.llvm.org/D19871#419954, @etienneb wrote:
> >
> > > In http://reviews.llvm.org/D19871#419947, @aaron.ballman wrote:
> > >
> > > > Is this required for some purpose?
> > >
> > >
> > > It's used in clang-tidy checkers.
> > >
> > >   see http://reviews.llvm.org/D19841
> >
> >
> > It's good to have that context in a review for functionality that isn't part of the proposed patch. :-) Looking at the other patch, I would prefer to keep this matcher narrowed to just clang-tidy unless you can also solve how to expose it via the dynamic registry so that it can be used by tools like clang-query.
>
>
> What we have done in the past with enum-arg matchers is to use string->enum conversion in the dynamic bindings.
>  See the specialization `ArgTypeTraits<attr::Kind>` in `Marshallers.h`.
>  We could add one for `CastKind` too.


I think I got the idea, I'll give a try to see the results. Thanks Samuel.


http://reviews.llvm.org/D19871





More information about the cfe-commits mailing list