<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>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.</div><div><br></div><div>For example i would like to  add the sat equivalent of this code to a CXXRecordDecl:</div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">float test = 4.0;</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">public:</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">float getTest() const</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">{return test;}</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; ">private:</div></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; "><br></div><div style="margin: 0px; ">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.</div><div style="margin: 0px; "><br></div><div style="margin: 0px; ">I hope i have been clear if not i'll be happy to give more details.</div><div style="margin: 0px; "><br></div><div style="margin: 0px; ">Thanks for your help</div><div style="margin: 0px; "><br></div><div style="margin: 0px; ">Emmanuel</div></body></html>