<div dir="ltr">I believe what you need are<br><div><em>clang::SourceManager::isInSystemHeader</em><br>and<br><em>clang::SourceManager::isInExternCSystemHeader</em><br></div><div><br></div><div>The documentation has the details: <a href="http://clang.llvm.org/doxygen/classclang_1_1SourceManager.html">http://clang.llvm.org/doxygen/classclang_1_1SourceManager.html</a></div>

<div>Basically, you need to provide them with a SourceLocation, and they will return a boolean value. The source location you can get for example using clang::SourceManager::getLocForStartOfFile, or from any AST node.</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/12 Tom Fairfield <span dir="ltr"><<a href="mailto:antirush@gmail.com" target="_blank">antirush@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div><div><div><div><div>I'm building a tool with the libtooling API - running an ASTFrontendAction with a RecursiveASTVisitor.<br><br></div>By default, the visitor gets run for all included files, including system headers (<string> and the like).<br>


<br></div>I can ignore all included files (and therefore only run on the files passed on the commandline) by overriding TraversDecl and checking<br><br>context->getSourceManager().isFromMainFile(d->getLocation());<br>


<br></div>Unfortunately, this stops me from traversing user included files.  Ideally, I'd like to traverse non-system headers and ignore system headers.  Is there a way to accomplish this? <br><br></div>Thanks!<span class="HOEnZb"><font color="#888888"><br>

<br>
</font></span></div><span class="HOEnZb"><font color="#888888">- Tom<br></font></span></div>
<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>
<br></blockquote></div><br></div>