[cfe-dev] Ignore the content from the included files with RecursiveASTVisitor

Etienne eollivier at bsu.edu
Mon Mar 17 16:13:04 PDT 2014


Hello,
I am working on a project where I am using the RecursiveASTVisitor to get
metrics from files.
I would like to exclude the parts of the AST that are from included files,
so the metrics I get concern only the file I want to analyze.
I tried to check the location of the Statements, Declarations etc and
exclude them if their location is not the file I am analyzing.
However this solution doesn't really work.
As an example if I call a function from cstdarg:


As the dump shows, the location of the CallExpr is in stdarg.h so my method
excludes it, even if I would like to keep it since it appears in my source
file


Would you have a suggestion to avoid this problem or an other method that
could work?
Thank you
Etienne



--
View this message in context: http://clang-developers.42468.n3.nabble.com/Ignore-the-content-from-the-included-files-with-RecursiveASTVisitor-tp4038480.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list