<div dir="ltr"><div><div>Hi,<br><br></div>You can get the SourceLocation of the Decl using getLocStart(), getLocEnd() or getLocation(). Then you can use SourceManager :: getBufferName() to get the name of the file containing the SourceLocation.<br>

<br></div>Hope this helps.<br><br>Gabor<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/21 suppamax <span dir="ltr"><<a href="mailto:max.giacometti@gmail.com" target="_blank">max.giacometti@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am using a RecursiveASTVisitor to get the declaration statements of my<br>
code.<br>
I took inspiration from the example shown here:<br>
<a href="http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang/" target="_blank">http://eli.thegreenplace.net/2012/06/08/basic-source-to-source-transformation-with-clang/</a><br>
<br>
I extended the example so to include "included" files in the AST (this is<br>
necessary to be able to identify variable declarations that use non-basic<br>
data types).<br>
<br>
Now I want to filter all variable declarations that are not part of the file<br>
that I want to analyze.<br>
How can I do this?<br>
<br>
<br>
Thanks a lot,<br>
Max<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Get-filename-from-ASTVisitor-tp4031615.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Get-filename-from-ASTVisitor-tp4031615.html</a><br>


Sent from the Clang Developers mailing list archive at Nabble.com.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>