[cfe-dev] getting all function calls?

ret val retval386 at gmail.com
Thu Jun 9 12:11:57 PDT 2011


I am still a bit confused.

Do you mean implement VisitCallExpr()? I have that implemented and it does
not run. VisitStmt() has a implmentation that only returns true, does this
mean its not as simple as you said before?

Better yet, am I missing a example or something that maybe I could hack away
at?

Thanks for putting up with this


On Thu, Jun 9, 2011 at 2:56 PM, Joshua Cranmer <Pidgeot18 at gmail.com> wrote:

> On 6/9/2011 11:40 AM, ret val wrote:
> > That part I follow. For declarations all Adrien had todo was:
> >
> > virtual void HandleTranslationUnit(ASTContext &context) {
> >             TranslationUnitDecl* tu_decl =
> > context.getTranslationUnitDecl();
> >             TraverseDecl(tu_decl);
> > }
> >
> > I would need something like this, but I don't know what I can pull
> > from the context that will be useful. Basically I don't know what the
> > commented out line should look like.
> >
> > virtual void HandleTranslationUnit(ASTContext &context) {
> >             //Stmt *s = context????
> >             TraverseStmt(s);
> > }
>
> No, what Adrien has is sufficient to traverse statements as well.
> TraverseDecl(tu_decl) will traverse the entire AST, which includes
> statements and expressions. That's why you have the RecursiveASTVisitor:
> it figures out how to visit all of the subchildren for you so you just
> have to worry about implementing VisitStmt and figuring out what to do
> on all of the statements in the file.
>
> --
> Joshua Cranmer
> News submodule owner
> DXR coauthor
>
>
> _______________________________________________
> 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/20110609/b9486b0e/attachment.html>


More information about the cfe-dev mailing list