[cfe-dev] Clang plugin modify AST
Mani
monamimani at gmail.com
Fri Dec 7 19:57:19 PST 2012
Hi,
I had posted this question on the clang user mailing list, but i go no response so I am trying it here. Thanks
I have been playing around with Clang and it's plugin facility for a while. I have a recursiveASTVisitor working. I am interested to modify some special classes that are tagged. I also managed to work this out with the annotate attribute. the part that i can't seem to figure out is how to modify the ast.
For example i would like to add the sat equivalent of this code to a CXXRecordDecl:
float test = 4.0;
public:
float getTest() const
{return test;}
private:
I read multiple time that the ast is supposed to be immutable, but i also read that there is maybe a solution with the sema. I want to point out I don't want to write this change back into the file but that the change get compile and that i would be able to call getTest in my code.
I hope i have been clear if not i'll be happy to give more details.
Thanks for your help
Emmanuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121207/69797e86/attachment.html>
More information about the cfe-dev
mailing list