[cfe-dev] ast_matchers::MatchFinder to CallExpr that's a macro call

Manuel Klimek klimek at google.com
Fri Apr 26 08:07:16 PDT 2013


On Fri, Apr 26, 2013 at 4:43 PM, Peeter Joot <peeter.joot at gmail.com> wrote:

>
> On Fri, Apr 26, 2013 at 9:31 AM, Manuel Klimek <klimek at google.com> wrote:
>
>> integerLiteral(equals(3)).bind("x"); same for declRefExpr. The only thing
>> you cannot bind here is "hasType", but I'm surprised this compiles at
>> all... stmt(hasType(pointsTo(...))).bind("x") should work...
>>
>
> I've tried:
>
>   Finder.addMatcher(
>         callExpr( allOf(
>               callee(functionDecl(hasName("myfunc"))),
>               hasArgument(1,
>                  stmt(hasType(
>                     pointsTo(
>                        pointsTo( recordDecl(hasName("void")) )
>                        )
>                     ))
>                     .bind("x")
>                  )
>            )),
>     &gmblkCallBack);
>
>
> This doesn't compile, and gives:
>
> error: no member named 'getType' in 'clang::Stmt'
>   return InnerMatcher.matches(Node.getType(), Finder, Builder);
>
> Is there a different way (or better approach to getting at the parameter
> data)?
>

Sorry, of course expr(hasType(...)).bind(...) :)


>
> --
> Peeter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130426/aeb492d7/attachment.html>


More information about the cfe-dev mailing list