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

Peeter Joot peeter.joot at gmail.com
Fri Apr 26 07:43:12 PDT 2013


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)?

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


More information about the cfe-dev mailing list