[cfe-dev] getting all function calls?
ret val
retval386 at gmail.com
Thu Jun 9 10:15:41 PDT 2011
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.)
Thanks
On Thu, Jun 9, 2011 at 12:57 PM, Joshua Cranmer <Pidgeot18 at gmail.com> wrote:
> On 6/9/2011 6:37 AM, ret val wrote:
> > Also, from CallExpr *node, is it possible to print the names of the
> > function being called and what called it? Since there seems to be no
> > real Symbol Table I'm not sure if this information is gone at this
> > point or not.
> >
> > Thanks again everyone
>
> From CallExpr, you can use getDirectCallee() to get a FunctionDecl* of
> the function being called (assuming it's not a function pointer call);
> since FunctionDecl is a subclass of NamedDecl, you can use that decl to
> get the name of the function.
>
> As for getting the function it's in, I'm sure there's a way to do it, I
> just don't know it off the top of my head.
>
> --
> 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/296a50e9/attachment.html>
More information about the cfe-dev
mailing list