[cfe-dev] Get filename from ASTVisitor

Vane, Edwin edwin.vane at intel.com
Mon Apr 22 06:23:30 PDT 2013

If you only care about parts of the AST that come from the source file and not the included files, SourceManager provides isFromMainFile().

-----Original Message-----
From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On Behalf Of suppamax
Sent: Sunday, April 21, 2013 12:45 PM
To: cfe-dev at cs.uiuc.edu
Subject: [cfe-dev] Get filename from ASTVisitor

I am using a RecursiveASTVisitor to get the declaration statements of my code.
I took inspiration from the example shown here:

I extended the example so to include "included" files in the AST (this is necessary to be able to identify variable declarations that use non-basic data types).

Now I want to filter all variable declarations that are not part of the file that I want to analyze.
How can I do this?

Thanks a lot,

View this message in context: http://clang-developers.42468.n3.nabble.com/Get-filename-from-ASTVisitor-tp4031615.html
Sent from the Clang Developers mailing list archive at Nabble.com.
cfe-dev mailing list
cfe-dev at cs.uiuc.edu

More information about the cfe-dev mailing list