[cfe-dev] How to implement equals(0) in clang-query

Manuel Klimek via cfe-dev cfe-dev at lists.llvm.org
Mon Jan 9 03:33:06 PST 2017


+kramerb

On Mon, Dec 26, 2016 at 9:45 PM Mads Ravn <madsravn at gmail.com> wrote:

> Hi,
>
> I have been wondering how to implement 'equals' for integer literals in
> clang-query. It doesn't seem to be working for string literals either. In
> Registry.cpp it says: "TODO: Here is the list of the missing matchers,
> grouped by reason." - here 'equals' is listed under 'Other'.
>
> So I guess there is a reason why it is not working for clang-query. Does
> anyone know what this reason is? I wouldn't mind fixing it, but the few
> things I have tried have all resulted in failures. I am not sure why it
> works in clang-tidy, but not in clang-query. Aren't they using the same
> code-base for matchers? I can see equals implemented in ASTMatchers.h, but
> why can't clang-query use that?
>

clang-tidy is just C++ code. clang-query uses a custom expression parser to
just support the matcher expressions; this will always be slightly
different from the full C++ template metaprogramming support, even if close.

Generally, we'll need to make the clang-query expression parser understand
the literal 0 and then make it understand that equals can take that literal.


> Can anyone point me in the right direction as how to implement this in
> clang-query? I imagine there is some blocking issue since it is not
> implemented already.
>
> Best regards,
> Mads Ravn
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170109/c6e5a037/attachment.html>


More information about the cfe-dev mailing list