<p dir="ltr">I'm not an expert on this but I think that's what you get by generating a compilation database for your project and feeding it to your tool.</p>
<div class="gmail_quote">On Apr 19, 2015 1:09 PM, "Saheel Godhane" <<a href="mailto:srgodhane@ucdavis.edu">srgodhane@ucdavis.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>On Friday, April 17, 2015, Nikola Smiljanic <<a href="mailto:popizdeh@gmail.com" target="_blank">popizdeh@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Use clang-query to try things out, you'll need to generate compilation database to use it but that shouldn't be too hard. It sure beats having to recompile your code to test it.<br><br>The matcher you're after is probably callExpr(callee(functionDecl(hasName("malloc"))))</div></blockquote><div><br></div><div>Hi Nikola,</div><div><br></div>I had a related question. Can I run such a matcher on a whole program? I am currently using the CSA framework but running into some issues and I think using the matchers suit my task better.<div><br></div><div>Thanks for your reply!</div><div>Saheel.<span></span><br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br>On Tue, Apr 7, 2015 at 10:49 AM, Riyad Parvez <<a>riyad.parvez@gmail.com</a>> wrote:<br>><br>> Hi All,<br>><br>> I want to find all the instances of calls to a specific function. Right now, I can find all the function calls using ASTMatcher using following code:<br>><br>> Finder.addMatcher(<br>> callExpr(hasParent(binaryOperator(hasOperatorName("=")).bind("assignment"))).bind("functionCall"),<br>> &HandlerForFunctionCall);<br>><br>> But I want to find all the function calls whose name is say "malloc". I know how do that using classic "RecursiveASTVisitor" class, but how can I do this using ASTMatcher?<br>><br>> Thanks<br>> Riyad<br>> _______________________________________________<br>> cfe-dev mailing list<br>> <a>cfe-dev@cs.uiuc.edu</a><br>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote><div> <br></div></div>
</blockquote></div>