[cfe-dev] how to get -ast-print to work?

Charles Davis cdavis at mymail.mines.edu
Thu Feb 4 06:21:01 PST 2010


Marko Sch├╝tz wrote:
> When I use -ast-print like below, I get an error.
> 
> marko at prpad:tmp% clang -cc1 col.c -ast-print
> gcc: unrecognized option '-cc1'
> /tmp/cc-05816a.s: Assembler messages:
> /tmp/cc-05816a.s:4: Warning: unterminated string; newline inserted
> /tmp/cc-05816a.s:5: Warning: unterminated string; newline inserted
> gcc: unrecognized option '-cc1'
> 
...
> This is with clang-2.6.
That's from before clang and clang-cc became a single executable. If you
want to print the AST with LLVM 2.6 clang, you have to run clang-cc
directly:

 /usr/pkg/libexec/clang-cc col.c -ast-print

Chip





More information about the cfe-dev mailing list