[cfe-dev] Obtaining file name for functions from included files
klimek at google.com
Tue Jun 19 05:47:09 PDT 2012
On Tue, Jun 19, 2012 at 2:34 PM, Felix Schmitt <
felix.schmitt at zih.tu-dresden.de> wrote:
> I got the following problem:
> I need to traverse the AST (currently using RecursiveASTVisitor) and get
> file name for every function declaration.
> Currently, I only get the filename for function declarations in my main
> file but
> how do I get these for functions in #included files?
> My relevant code looks like this (srcMgr is the SourceManager):
> bool CMyASTVisitor::VisitFunctionDecl(FunctionDecl* decl)
> const FileEntry* file_entry =
> if (file_entry == NULL)
> std::cout << "no file entry" << std::endl;
> Is there a way to get these filenames?
Why does file_entry->getName() not work?
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev