Clang AST visitor, avoid traversing include files
<p>Hello I am trying to implement an AST Clang visitor and this is my code.</p>

<pre><code>class ExampleVisitor : public RecursiveASTVisitor&lt;ExampleVisitor&gt; {
private:
    ASTContext *astContext; // used for getting additional AST info

public:
    virtual bool VisitVarDecl(VarDecl *var) 
    {
        numVariables++;
        string varName = var-&gt;getQualifiedNameAsString();
        string varType = var-&gt;getType().getAsString();
        cout &lt;&lt; "Found variable declaration: " &lt;&lt; varName &lt;&lt; " of type " &lt;&lt; varType &lt;&lt; "\n";
        APIs &lt;&lt; varType &lt;&lt; ", ";
        return true;
    }

    virtual bool VisitFunctionDecl(FunctionDecl *func)
    {
        numFunctions++;
        string funcName = func-&gt;getNameInfo().getName().getAsString();
        string funcType = func-&gt;getResultType().getAsString();
        cout &lt;&lt; "Found function declaration: " &lt;&lt; funcName &lt;&lt; " of type " &lt;&lt; funcType &lt;&lt; "\n";
        APIs &lt;&lt; "\n\n" &lt;&lt; funcName &lt;&lt;": ";
        APIs &lt;&lt; funcType &lt;&lt; ", ";
        return true;
    }

    virtual bool VisitStmt(Stmt *st) 
    {
        if (CallExpr *call = dyn_cast&lt;CallExpr&gt;(st)) 
        {
            numFuncCalls++;
            FunctionDecl *func_decl = call-&gt;getDirectCallee();
            string funcCall = func_decl-&gt;getNameInfo().getName().getAsString();
            cout &lt;&lt; "Found function call: " &lt;&lt; funcCall &lt;&lt; " with arguments ";
            APIs &lt;&lt; funcCall &lt;&lt; ", ";
            for(int i=0, j = call-&gt;getNumArgs(); i&lt;j; i++)
            {
                string TypeS;
                raw_string_ostream s(TypeS);
                call-&gt;getArg(i)-&gt;printPretty(s, 0, Policy);
                cout&lt;&lt; s.str() &lt;&lt; ", ";
                APIs&lt;&lt; s.str() &lt;&lt; ", ";
           }
            cout &lt;&lt; "\n";
        }
        return true;
    }
};
</code></pre>

<p>How can I avoid traversing the included header files, but without loosing their information. I just dont want to print any information about this files but I want clang to know about these files</p>

<p>Thank you</p>