<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"))))<br><br>On Tue, Apr 7, 2015 at 10:49 AM, Riyad Parvez <<a href="mailto:riyad.parvez@gmail.com">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 href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div>