Questions about using Clang for source to source transformation.


I’m working in a project involving source to source transformation of some arbitrary c code , I’m looking forward to using Clang
my main problem is where to start , I can find approx. no documentation on topic

Any existing source to source sample codes based on clang that can be of help as a starting point ?

I want to know the Clang APIs for building a AST and rewriting codes from the AST.


We have an objective-c to c++ source transformation. This involves a combination of AST to c++ source xformation and
direct replacement of source with other source. Look at lib/Rewrite and lib/Frontend/Rewrite files.

  • Fariborz