<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 26, 2013 at 11:07 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">Sorry, of course expr(hasType(...)).bind(...) :)</blockquote>
</div><br>Okay thanks, that compiles now.  However, it appears that my attempt to match to the void ** itself is not working.  Even if I take out the attempt to bind to the parameter and just bind to the whole call statement, it doesn't trigger.  Example:<br>
<br><div class="gmail_extra">  Finder.addMatcher(</div><div class="gmail_extra">        callExpr( callee(functionDecl(hasName("myfunc"))) ).bind("x"),</div><div class="gmail_extra">    &gmblkCallBack);</div>
<div class="gmail_extra"><br></div><div class="gmail_extra" style>triggers the callback:</div><div class="gmail_extra" style><br></div><div class="gmail_extra" style><div class="gmail_extra">match callback</div><div class="gmail_extra">
<s>myfunc( &r )</s></div><div class="gmail_extra">match callback</div><div class="gmail_extra"><s>myfunc( (void **)&r )</s></div><div><br></div><div style>where the source was:</div><div style>
<br></div><div style><div>int myfunc( void ** ppBlkPtr ) ;</div><div><br></div><div>void blah(void)</div><div>{</div><div>   //int * r ;</div><div>   void * r ;</div><div><br></div><div>   myfunc( &r ) ;</div><div>   myfunc( (void **)&r ) ;</div>
<div>}</div><div><br></div></div><div style>But this matcher doesn't trigger:</div></div><div class="gmail_extra"><br></div><div class="gmail_extra">  Finder.addMatcher(</div><div class="gmail_extra">        callExpr( allOf(</div>
<div class="gmail_extra">              callee(functionDecl(hasName("myfunc"))),</div><div class="gmail_extra">              hasArgument(0,</div><div class="gmail_extra">//                 expr(</div><div class="gmail_extra">
                    hasType(</div><div class="gmail_extra">                    pointsTo(</div><div class="gmail_extra">                       pointsTo( recordDecl(hasName("void")) )</div><div class="gmail_extra">
                       )</div><div class="gmail_extra">                    )</div><div class="gmail_extra">//                       ).bind("x")</div><div class="gmail_extra">                 )</div><div class="gmail_extra">
           ))</div><div class="gmail_extra">                       .bind("x")</div><div class="gmail_extra">        ,</div><div class="gmail_extra">    &gmblkCallBack);</div><div><br></div></div><div class="gmail_extra" style>
Maybe my best bet is not to try to use this matcher infrastructure for anything bug the call itself, and then manipulate or navigate that portion of the AST directly in the callback.</div><div class="gmail_extra"><br>-- <br>
Peeter
</div></div>