Viewing ASTs

Hi,

I am trying to view the AST obtained after parsing, in a graphical
representation.
Certain web pages spoke about a command line option '-ast-view' that helps
in viewing
these through graphviz. However when I use the -ast-view option, the
compiler throws a warning saying

clang: warning: argument unused during compilation: '-ast-view'

Is there anything that I might be missing out? I could not find any notes on
this in the clang manuals.

Thanks,
Kavya

Hi Kavya,

-ast-view is only available as a cc1 command. You're passing it to the driver.

Invoke clang with -### to find the command the driver is forming to compile. Then copy-paste that command, adding -ast-view (or --help-hidden to see all the cc1 options).

Cheers,

James