[cfe-dev] Traversing a function body for call expressions. How ?

Gabor Kozar kozargabor at gmail.com
Fri Dec 5 18:48:22 PST 2014


Hi,

It should work. Define an StmtVisitor subclass, provide a VisitCallExpr.
Then in your Visitor::VisitFunctionDecl, construct an StmtVisitor
object, then call its Visit method with the function's body.

In the future, please also provide source code, to allow us to spot any
bugs and problems in your code (e.g. you may believe that the code does
what you say it does, but you might have a bug, etc.).

---
Best regards,

Gábor 'ShdNx' Kozár http://gaborkozar.me



On Wed, Dec 3, 2014, at 07:11, Manasij Mukherjee wrote:
> Hi, In a RecursiveASTVisitor implementation, I implement
> VisitFunctionDecl. Now, from the FunctionDecl I have, I can call
> getBody and get a Stmt.
>
> How can I visit all the functions this function calls ? I have tried
> creating a StmtVisitor and ..err..defining VisitCallExpr ! That
> didn't work.
>
> Can anyone point me to what I should be doing ?
>
> Manasij Mukherjee
> _________________________________________________
> cfe-dev mailing list cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

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


More information about the cfe-dev mailing list