<html><head></head><body><div class="ydp105471dbyahoo-style-wrap" style="font-family:times new roman, new york, times, serif;font-size:13px;"><div></div>
        <div dir="ltr" data-setdir="false">Hi all,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I would like to modify the clang AST using a plugin.</div><div dir="ltr" data-setdir="false">I have following the suggestions of using clang Rewriter object.</div><div dir="ltr" data-setdir="false">I use compiler.createDefaultOutputFile() to obtain the output stream to write the changed file into.</div><div dir="ltr" data-setdir="false">the compilation works fine but the generated object file is broken. </div><div dir="ltr" data-setdir="false">I get the following linker error: "Wrong file format".</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Question:</div><div dir="ltr" data-setdir="false">- Is it actually possible to update the AST using a clang plugin?</div><div dir="ltr" data-setdir="false">- What am I doing wrong with my solution?</div><div dir="ltr" data-setdir="false">- Can someone point me to an example program that does that?</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Thanks,</div><div dir="ltr" data-setdir="false">-Blaise</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"> </div></div></body></html>