ast dump logic

Hi all,
Can any one tell me what is logic or code of ast dump. how the clang dump the ast on console using dump option.



i don’t know if this is what you are looking for, but i use the following command to create the AST of a code file from the command line:

clang -cc1 -ast-dump -x <INPUT_FILE>

For example, to generate the AST of an OpenCL kernel file: clang -cc1 -ast-dump -x cl > output.ast

2012/4/11 akshay ratnaparkhi <>