[cfe-dev] HOW TO GET smallest AST

Nikola Smiljanic popizdeh at gmail.com
Thu Mar 19 21:16:19 PDT 2015


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.

On Fri, Mar 20, 2015 at 2:27 PM, kaka <aamen521 at 163.com> wrote:

>
> a cpp like this:
> #include<stdio.h>
> int mian()
> {
>  printf("aa");
> }
>
> when I get the AST of this cpp,
> All the decl identify ..  in stdio.h
> included in the AST.
>
> How Can I get The AST only contain decl I wrote or used.
>
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/HOW-TO-GET-smallest-AST-tp4044597.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150320/e438f8ea/attachment.html>


More information about the cfe-dev mailing list