<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 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 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 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>