Question about using Clang for source to source transformation.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Question about using Clang for source to source transformation.

mywayin2sky
 Hello,
I want to insert new functions into original source code.
So, I tried to do as below.

Since I have a ASTContext object,
I make a QualType object using ASTContext.getFunctionType() and
also make a IdentifierInfo object.
And then finally make a FunctionDecl Object using FunctionDecl::Create().

There are no compiler-time or run-time errors.
But I fail to make a new function object.

Similary, I can replace original statments with new statements.
But It's difficult to create a new statement indepedently.
How can I make a new expr, stmt, or function without using existing one?
If you have any sample code, please let me know.

Any suggestion will be very helpful to me.
Thank you.

- K

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev