<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 26, 2013 at 12:45 AM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div>Note that the AST dump does not contain all the information there is (or it would be completely unreadable).</div>
<div><br></div></blockquote><div style>Is there any way to do a very verbose dump rooted at a specific expression?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div></div><div>With AST matchers, you can currently only match the "C++" names of things. After matching the call, you can look at the expansion location of the identifier that references the function (get it via the SourceManager) or try to directly use the Lexer's makeFileCharRange.</div>
</blockquote></div><br>To simplify the problem, I'll hack the code in this case to use a fake prototype, one that looks like the macro interface.  Then the problem becomes manipulating the parameters.</div><div class="gmail_extra">
<br></div><div class="gmail_extra" style>I see in the match test code stuff like:<br><br><div class="gmail_extra">  const char Program[] =</div><div class="gmail_extra">      "struct T { };"</div><div class="gmail_extra">
      "int f(int, T*, int, int);"</div><div class="gmail_extra">      "void g(int x) { T t; f(x, &t, 3, 4); }";</div><div class="gmail_extra"> ...</div><div class="gmail_extra">  EXPECT_TRUE(matches(Program,</div>
<div class="gmail_extra">      callExpr(allOf(callee(functionDecl(hasName("f"))),</div><div class="gmail_extra">                     hasArgument(0, declRefExpr(to(varDecl()))),</div><div class="gmail_extra">                     hasArgument(1, hasType(pointsTo(</div>
<div class="gmail_extra">                                        recordDecl(hasName("T"))))),</div><div class="gmail_extra">                     hasArgument(2, integerLiteral(equals(3))),</div><div class="gmail_extra">
                     hasArgument(3, integerLiteral(equals(4)))))));</div><div><br></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">How would I bind the matcher to one of these parameters?<br clear="all">
<div><br></div>-- <br>Peeter
</div></div>