[cfe-dev] source-to-source transformation: how-to?

Ute Wappler wappler at se.inf.tu-dresden.de
Mon Feb 18 00:26:37 PST 2008


Hi All,

I intend to use clang for C source-to-source transformation. I want to enhance 
the code with additional redundance so that it will be possible to detect 
hardware errors.

I had no problems to obtain the AST. Now I am trying to modify it. Let's take 
for example the CompoundStmt. It seems that it is only possible to append 
additional statments to it. But I would like to insert new ones on arbitrary 
positions. So, my idea was to read the old AST and produce a new one which 
will contain my modifications. My question is: Is this the way to go? Did I 
overlook another simpler solution?

Thanks for any help and suggestions,
Ute



More information about the cfe-dev mailing list