[cfe-dev] Missing statements in the Clang print AST

Dmitri Gribenko gribozavr at gmail.com
Fri Jan 18 02:31:23 PST 2013


On Fri, Jan 18, 2013 at 12:23 PM, Miguel Aguilar
<miguel.aguilar at ice.rwth-aachen.de> wrote:
> Hi,
>
> I am trying to inspect the AST generated by clang of a simple C++ program.
> However in the body of the printed function are missing statements and
> functions call with respect to the original code. Can you tell me what
> parameters are missing while calling clang?

Hello Miguel,

The parameters are correct.  The AST printer in Clang is a bit broken.
 Patches welcome!

If you just need to inspect the AST, try -ast-dump.  It displays all AST nodes.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-dev mailing list