[cfe-dev] getting all function calls?

ret val retval386 at gmail.com
Thu Jun 9 11:40:07 PDT 2011


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);
}



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

> On 6/9/2011 10:15 AM, ret val wrote:
> > Do you happen to know anything about the TraverseStmt() method from my
> > previous post any chance? Thats stopping me from digging in more.
> >
> > (I see the equivalent TraverseStmt() method now, but I do not see a
> > way to get statements fron the ASTContext.)
>
> What you need to do is start the traversing in the HandleTranslationUnit
> method. So long as you keep returning true in the methods you implement,
> you will visit every node. (Side note: there's no way to disable
> visiting particular subtrees, as far as I can see...)
>
> --
> 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/580d159c/attachment.html>


More information about the cfe-dev mailing list