clang -cc1 -ast-dump your_file.c
We provide an online AST viewer for you to interact with clang AST more friendly. To view the AST, please follow these steps.



auto lambda(int n) {
auto x = getchar();
auto y = (int *)malloc(8);
*y = x;
auto z = *y;
return x;
}

The Clang AST looks like this. Use the API in the figure to get the corresponding properties when doing traversals.