<html><head></head><body><div class="ydp93470331yahoo-style-wrap" style="font-family:times new roman, new york, times, serif;font-size:13px;"><div></div>
        <div dir="ltr" data-setdir="false">Thank you Nico,</div><div dir="ltr" data-setdir="false"><br></div><div><br></div>
        
        </div><div id="ydp77180bbbyahoo_quoted_9173454740" class="ydp77180bbbyahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Monday, January 13, 2020, 02:58:09 PM EST, Nico Weber <thakis@chromium.org> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="ydp77180bbbyiv8570143077"><div><div dir="ltr">This is generally explicitly not supported: <a shape="rect" href="https://clang.llvm.org/docs/InternalsManual.html#immutability" rel="nofollow" target="_blank">https://clang.llvm.org/docs/InternalsManual.html#immutability</a><div><br clear="none"></div><div>In some cases you can hack around that: <a shape="rect" href="https://www.youtube.com/watch?v=_rUwW8Awc5s" rel="nofollow" target="_blank">https://www.youtube.com/watch?v=_rUwW8Awc5s</a></div></div><br clear="none"><div class="ydp77180bbbyiv8570143077gmail_quote"><div class="ydp77180bbbyiv8570143077yqt6348806367" id="ydp77180bbbyiv8570143077yqt28084"><div class="ydp77180bbbyiv8570143077gmail_attr" dir="ltr">On Mon, Jan 13, 2020 at 1:16 PM Blaise Tine via cfe-dev <<a shape="rect" href="mailto:cfe-dev@lists.llvm.org" rel="nofollow" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br clear="none"></div><blockquote class="ydp77180bbbyiv8570143077gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;"><div><div><div></div>
        <div dir="ltr">Hi all,</div><div dir="ltr"><br clear="none"></div><div dir="ltr">I would like to modify the clang AST using a plugin.</div><div dir="ltr">I have following the suggestions of using clang Rewriter object.</div><div dir="ltr">I use compiler.createDefaultOutputFile() to obtain the output stream to write the changed file into.</div><div dir="ltr">the compilation works fine but the generated object file is broken. </div><div dir="ltr">I get the following linker error: "Wrong file format".</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Question:</div><div dir="ltr">- Is it actually possible to update the AST using a clang plugin?</div><div dir="ltr">- What am I doing wrong with my solution?</div><div dir="ltr">- Can someone point me to an example program that does that?</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Thanks,</div><div dir="ltr">-Blaise</div><div dir="ltr"><br clear="none"></div><div dir="ltr"> </div></div></div>_______________________________________________<br clear="none">
cfe-dev mailing list<br clear="none">
<a shape="rect" href="mailto:cfe-dev@lists.llvm.org" rel="nofollow" target="_blank">cfe-dev@lists.llvm.org</a><br clear="none">
<a shape="rect" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="nofollow" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br clear="none">
</blockquote></div></div></div></div></div>
            </div>
        </div></body></html>