Mads Ravn via llvm-dev
2016-Nov-26 21:27 UTC
[llvm-dev] Looking for help with an ast matcher
Hi, Hope this is the right channel for this question. I am trying to make an ast matcher for clang-tidy to find str1.compare(str2), where both str1 and str2 are std::string. I have this so far: http://i.imgur.com/sUma9WC.png . But I am having a hard time finding a way to bind an id to the str1 part of the expression. Can anyone help me out with an idea? Best regards, Mads Ravn -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161126/b9c2f178/attachment.html>
Piotr Padlewski via llvm-dev
2016-Nov-27 21:34 UTC
[llvm-dev] Looking for help with an ast matcher
Hi Mads, Can you provide the code that you run clang-query on, or at least AST for the fragment you want to match? Piotr 2016-11-26 22:27 GMT+01:00 Mads Ravn via llvm-dev <llvm-dev at lists.llvm.org>:> Hi, > > Hope this is the right channel for this question. I am trying to make an > ast matcher for clang-tidy to find str1.compare(str2), where both str1 and > str2 are std::string. I have this so far: http://i.imgur.com/sUma9WC.png . > But I am having a hard time finding a way to bind an id to the str1 part of > the expression. > > Can anyone help me out with an idea? > > Best regards, > Mads Ravn > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161127/28a20399/attachment.html>
Piotr Padlewski via llvm-dev
2016-Nov-27 21:35 UTC
[llvm-dev] Looking for help with an ast matcher
Adding cfe-dev, because it is related to clang, not LLVM. 2016-11-27 22:34 GMT+01:00 Piotr Padlewski <piotr.padlewski at gmail.com>:> Hi Mads, > Can you provide the code that you run clang-query on, or at least AST for > the fragment you want to match? > > Piotr > > 2016-11-26 22:27 GMT+01:00 Mads Ravn via llvm-dev <llvm-dev at lists.llvm.org > >: > >> Hi, >> >> Hope this is the right channel for this question. I am trying to make an >> ast matcher for clang-tidy to find str1.compare(str2), where both str1 and >> str2 are std::string. I have this so far: http://i.imgur.com/sUma9WC.png . >> But I am having a hard time finding a way to bind an id to the str1 part of >> the expression. >> >> Can anyone help me out with an idea? >> >> Best regards, >> Mads Ravn >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161127/f1a2bf1d/attachment.html>