[cfe-dev] getting all function calls?

Joshua Cranmer Pidgeot18 at gmail.com
Thu Jun 9 09:57:28 PDT 2011


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





More information about the cfe-dev mailing list