<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Could you not use the SourceLocation to
      work out if the declaration was in the main file?<br>
      <br>
      On 20/03/15 04:16, Nikola Smiljanic wrote:<br>
    </div>
    <blockquote
cite="mid:CAGq7tnMW4XnYf6MgEY_o5z4jA7V04FEfarwrAouXx+2vC5+saQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">You can't, the AST is built from the preprocessed
        file. In this specific case you could get away with it by
        providing a printf declaration and not including stdio.h but
        this solution doesn't really scale.</div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Mar 20, 2015 at 2:27 PM, kaka <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:aamen521@163.com" target="_blank">aamen521@163.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
            a cpp like this:<br>
            #include<stdio.h><br>
            int mian()<br>
            {<br>
             printf("aa");<br>
            }<br>
            <br>
            when I get the AST of this cpp,<br>
            All the decl identify ..  in stdio.h<br>
            included in the AST.<br>
            <br>
            How Can I get The AST only contain decl I wrote or used.<br>
            <br>
            <br>
            <br>
            <br>
            --<br>
            View this message in context: <a moz-do-not-send="true"
href="http://clang-developers.42468.n3.nabble.com/HOW-TO-GET-smallest-AST-tp4044597.html"
              target="_blank">http://clang-developers.42468.n3.nabble.com/HOW-TO-GET-smallest-AST-tp4044597.html</a><br>
            Sent from the Clang Developers mailing list archive at
            Nabble.com.<br>
            _______________________________________________<br>
            cfe-dev mailing list<br>
            <a moz-do-not-send="true" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
            <a moz-do-not-send="true"
              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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>