<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div id="yiv4430163137" class="" style=""><div class="" style=""><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;" class=""><div id="yiv4430163137yui_3_16_0_6_1407867329136_4" class="" style=""><span id="yiv4430163137yui_3_16_0_6_1407867329136_13" class="" style="">Hi Vassil,</span></div><div id="yiv4430163137yui_3_16_0_6_1407867329136_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;" class=""><span id="yiv4430163137yui_3_16_0_6_1407867329136_16" class="" style=""><br clear="none" style=""></span></div><div id="yiv4430163137yui_3_16_0_6_1407867329136_4"
 style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;" class=""><span class="" style="">I really wasn't expecting this to work, but I tried it out anyway. Sadly, it still did not change anything.</span></div><div id="yiv4430163137yui_3_16_0_6_1407867329136_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;" class=""><span class="" style="">With or without the Visitor, calling the HandleTopLevelDecl instead of HandleTranslationUnit did not give me the desired effect.</span></div><div id="yiv4430163137yui_3_16_0_6_1407867329136_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande',
 sans-serif;font-style:normal;background-color:transparent;" class="">From my side I think the problem resides in how the Rewriter affects the AST. I have the strange feeling that it doesn't really do anything to actually change the original AST, but instead it just buffers the user changes (as per the class' name). With respect to that, I have not found a way it (if possible) to pass the buffer to the CodeGenerator AST Consumer. Is this at all possible?</div><div id="yiv4430163137yui_3_16_0_6_1407867329136_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;" class=""><br></div><div id="yiv4430163137yui_3_16_0_6_1407867329136_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"
 class="">Cheers,</div><div id="yiv4430163137yui_3_16_0_6_1407867329136_4" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;" class="">Bogdan</div> <div class="" id="yiv4430163137yqt28115" style=""><div class="" id="yiv4430163137yui_3_16_0_6_1407867329136_7" style="display: none;"> <div class="" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div class="" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div dir="ltr" class="" style=""> <font size="2" face="Arial" class="" style=""> On Tuesday, August 12, 2014 7:19 PM, Vassil Vassilev <vvasilev@cern.ch> wrote:<br clear="none" class="" style=""> </font> </div>  <br clear="none" class="" style=""><br clear="none" class="" style=""> <div class=""
 style=""><div id="yiv4430163137" class="" style=""><div class="" style="">
    <div class="" style="">Hi Bogdan,<br clear="none" class="" style="">
        It seems that your visitor is called too late, i.e on
      HandleTranslationUnit. You should override HandleTopLevelDecl
      instead.<br clear="none" class="" style="">
      Cheers,<br clear="none" class="" style="">
      Vassil<br clear="none" class="" style="">
      On 12/08/14 10:53, Bogdan Tabacaru wrote:<br clear="none" class="" style="">
    </div>
    <blockquote type="cite" class="" style="">
      </blockquote></div><div class="" id="yiv4430163137yqt48551" style=""><div class="" style=""><div class="" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
        <div class="" style=""><span class="" style="">Hi Vassil,</span></div>
        <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style=""><br clear="none" class="" style="">
          </span></div>
        <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="">I have attempted to debug the Rewriter and
            CodeGenerator myself and see what happens when compiling,
            but the amount of code is rather massive and will take some
            time.</span></div>
        <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style=""><br clear="none" class="" style="">
          </span></div>
        <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida           Grande', sans-serif;font-style:normal;background-color:transparent;">Here is an running simplified example of what I
          am doing. Would mind running it and telling me whether it
          worked for you or not?</div>
        <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida           Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
        </div>
        <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida           Grande', sans-serif;font-style:normal;background-color:transparent;">Cheers,</div>
        <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida           Grande', sans-serif;font-style:normal;background-color:transparent;">Bogdan</div>
        <div class="" style=""><br clear="none" class="" style="">
          <br clear="none" class="" style="">
        </div>
        <div class="" style="display:block;">
          <div class="" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:12pt;">
            <div class="" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:12pt;">
              <div dir="ltr" class="" style=""> <font face="Arial" size="2" class="" style=""> On Monday,
                  August 11, 2014 11:18 AM, Bogdan Tabacaru
                  <a rel="nofollow" shape="rect" class="" ymailto="mailto:bogdan.tabacaru88@yahoo.com" target="_blank" href="mailto:bogdan.tabacaru88@yahoo.com" style=""><bogdan.tabacaru88@yahoo.com></a> wrote:<br clear="none" class="" style="">
                </font> </div>
              <br clear="none" class="" style="">
              <br clear="none" class="" style="">
              <div class="" style="">
                <div id="yiv4430163137" class="" style="">
                  <div class="" style="">
                    <div class="" style="color:rgb(0, 0, 0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:12pt;background-color:rgb(255, 255, 255);">
                      <div class="" style=""><span class="" style="">That is a good question.</span></div>
                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style=""><br clear="none" class="" style="">
                        </span></div>
                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="">I have written a libTool
                          with the same visitor and consumer.</span></div>
                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="">I called
                          my_Rewriter.ReplaceText() to make my
                          AST-transformations.</span></div>
                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="">I have output the
                          RewriteBuffer to a new file and then I
                          compiled it.</span></div>
                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;">When I run the transformed source,
                        it gives me the expected behavior. However, this
                        requires me to explicitly create a new file with
                        the changes.</div>
                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                      </div>
                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;">If I do the same thing with the
                        PluginASTAction (with or without re-ordering the
                        Consumers), I only get the behavior from the
                        original source file.</div>
                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                      </div>
                      <div class="" style=""><br clear="none" class="" style="">
                        <br clear="none" class="" style="">
                      </div>
                      <div class="" id="yiv4430163137yqt97309" style="">
                        <div class="" style="display:block;">
                          <div class="" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida                             Grande', sans-serif;font-size:12pt;">
                            <div class="" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:12pt;">
                              <div dir="ltr" class="" style=""> <font face="Arial" size="2" class="" style=""> On Monday, August 11, 2014
                                  9:59 AM, Vassil Vassilev
                                  <a rel="nofollow" shape="rect" class="" ymailto="mailto:vasil.georgiev.vasilev@cern.ch" target="_blank" href="mailto:vasil.georgiev.vasilev@cern.ch" style=""><vasil.georgiev.vasilev@cern.ch></a>
                                  wrote:<br clear="none" class="" style="">
                                </font> </div>
                              <br clear="none" class="" style="">
                              <br clear="none" class="" style="">
                              <div class="" style="">
                                <div id="yiv4430163137" class="" style="">
                                  <div class="" style="">
                                    <div class="" style="">On
                                      08/10/2014 11:02 AM, Bogdan
                                      Tabacaru wrote:<br clear="none" class="" style="">
                                    </div>
                                    <blockquote type="cite" class="" style=""> </blockquote>
                                  </div>
                                  <div class="" style="">
                                    <div class="" style="color:rgb(0, 0, 0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:12pt;background-color:rgb(255, 255,                                       255);">
                                      <div class="" style=""><span class="" style="">Hi Vassil,</span></div>
                                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida                                         Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style=""><br clear="none" class="" style="">
                                        </span></div>
                                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida                                         Grande', sans-serif;font-style:normal;background-color:transparent;">thanks for the
                                        example and the patch!</div>
                                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida                                         Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                      </div>
                                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida                                         Grande', sans-serif;font-style:normal;background-color:transparent;">I have applied
                                        both of them successfully, but
                                        somehow, re-ordering the
                                        consumers still did not give me
                                        the expected results. This
                                        means, when I call the plugin it
                                        executes correctly, but CodeGen
                                        still only uses the original
                                        file (without the changes made
                                        by the plugin).</div>
                                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida                                         Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                      </div>
                                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida                                         Grande', sans-serif;font-style:normal;background-color:transparent;">Is there another
                                        step which I may have forgotten?</div>
                                      <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida                                         Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                      </div>
                                    </div>
                                      If you reorder the consumers in
                                    the initialization, it should work.
                                    Are you sure you have the right
                                    tests to check for the desired
                                    behaviour? I.e are you sure you are
                                    making a valid AST-transformation?
                                    <div class="" id="yiv4430163137yqtfd61983" style=""><br clear="none" class="" style="">
                                      Vassil<br clear="none" class="" style="">
                                      <blockquote type="cite" class="" style="">
                                        <div class="" style="color:rgb(0, 0, 0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:12pt;background-color:rgb(255,                                           255, 255);">
                                          <div class="" style="color:rgb(0, 0,                                             0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;">Cheers,</div>
                                          <div class="" style="color:rgb(0, 0,                                             0);font-size:16px;font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-style:normal;background-color:transparent;">Bogdan</div>
                                          <div class="" style=""><br clear="none" class="" style="">
                                            <br clear="none" class="" style="">
                                          </div>
                                          <div class="" style="display:block;">
                                            <div class="" style="font-family:HelveticaNeue, 'Helvetica                                               Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:12pt;">
                                              <div class="" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:12pt;">
                                                <div dir="ltr" class="" style=""> <font face="Arial" size="2" class="" style=""> On Sunday,
                                                    August 10, 2014
                                                    12:22 AM, Vassil
                                                    Vassilev <a rel="nofollow" shape="rect" class="" ymailto="mailto:vvasilev@cern.ch" target="_blank" href="mailto:vvasilev@cern.ch" style=""><vvasilev@cern.ch></a>
                                                    wrote:<br clear="none" class="" style="">
                                                  </font> </div>
                                                <br clear="none" class="" style="">
                                                <br clear="none" class="" style="">
                                                <div class="" style="">
                                                  <div id="yiv4430163137" class="" style="">
                                                    <div class="" style="">
                                                      <div class="" style="">Hi
                                                        Bogdan,<br clear="none" class="" style="">
                                                          After applying
                                                        the attached
                                                        patch, I can do:<br clear="none" class="" style="">
                                                        <br clear="none" class="" style="">
                                                        void
                                                        MyPlugin::Initialize(ASTContext&
                                                        Context) {<br clear="none" class="" style="">
                                                          </div>
                                                    </div>
                                                    <div class="" style=""> // We need to
                                                      reorder the
                                                      consumers in the
                                                      MultiplexConsumer.<br clear="none" class="" style="">
                                                      MultiplexConsumer&
                                                      multiplex<br clear="none" class="" style="">
                                                      =
                                                      static_cast<MultiplexConsumer&>(m_CI.getASTConsumer());<br clear="none" class="" style="">
                                                      std::vector<ASTConsumer*>&
                                                      consumers =
                                                      multiplex.getConsumers();<br clear="none" class="" style="">
                                                      ASTConsumer*
                                                      lastConsumer =
                                                      consumers.back();<br clear="none" class="" style="">
consumers.pop_back();<br clear="none" class="" style="">
                                                      consumers.insert(consumers.begin(),
                                                      lastConsumer);<br clear="none" class="" style="">
                                                      }<br clear="none" class="" style="">
                                                      <br clear="none" class="" style="">
                                                      This allows me to
                                                      hook MyPlugin
                                                      before clang's
                                                      codegen.<br clear="none" class="" style="">
                                                      <br clear="none" class="" style="">
                                                      Vassil<br clear="none" class="" style="">
                                                      On 09/08/14 21:24,
                                                      Bogdan Tabacaru
                                                      wrote:<br clear="none" class="" style="">
                                                      <blockquote type="cite" class="" style=""> </blockquote>
                                                    </div>
                                                    <div class="" id="yiv4430163137yqt71669" style="">
                                                      <div class="" style="">
                                                        <div class="" style="color:rgb(0, 0, 0);font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-size:12pt;background-color:rgb(255, 255,                                                           255);">
                                                          <div class="" style=""><span class="" style="">Hi
                                                          Vassil,</span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style=""><br clear="none" class="" style="">
                                                          </span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="">Is
                                                          the patch
                                                          available for
                                                          the 3.4.2
                                                          version of
                                                          LLVM or must I
                                                          migrate to the
                                                          "current"
                                                          version ?</span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style=""><br clear="none" class="" style="">
                                                          </span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="">Cheers,</span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="">Bogdan</span></div>
                                                          <div class="" style=""><br clear="none" class="" style="">
                                                          <br clear="none" class="" style="">
                                                          </div>
                                                          <div class="" style="display:block;">
                                                          <div class="" style="font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-size:12pt;">
                                                          <div class="" style="font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-size:12pt;">
                                                          <div dir="ltr" class="" style="">
                                                          <font face="Arial" size="2" class="" style=""> On
                                                          Friday, August
                                                          8, 2014 6:16
                                                          PM, Vassil
                                                          Vassilev <a rel="nofollow" shape="rect" class="" ymailto="mailto:vvasilev@cern.ch" target="_blank" href="mailto:vvasilev@cern.ch" style=""><vvasilev@cern.ch></a>
                                                          wrote:<br clear="none" class="" style="">
                                                          </font> </div>
                                                          <br clear="none" class="" style="">
                                                          <br clear="none" class="" style="">
                                                          <div class="" style="">
                                                          <div id="yiv4430163137" class="" style="">
                                                          <div class="" style="">
                                                          <div class="" style="">Hi,<br clear="none" class="" style="">
                                                            There is a
                                                          pending patch
                                                          on cfe-commits
                                                          about this
                                                          "[PATCH]
                                                          clang/Frontend/MultiplexConsumer.h".
                                                          With it you
                                                          could reorder
                                                          the
                                                          ASTConsumers
                                                          in clang and
                                                          get yours
                                                          before
                                                          codegen.<br clear="none" class="" style="">
                                                          Vassil<br clear="none" class="" style="">
                                                          On 08/08/14
                                                          16:48, Bogdan
                                                          Tabacaru
                                                          wrote:<br clear="none" class="" style="">
                                                          </div>
                                                          <blockquote type="cite" class="" style=""> </blockquote>
                                                          </div>
                                                          <div class="" style="">
                                                          <div class="" id="yiv4430163137yqt84664" style="">
                                                          <div class="" style="color:rgb(0, 0, 0);font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-size:12pt;background-color:rgb(255, 255,                                                           255);">
                                                          <div class="" style="">Hi
                                                          everyone,</div>
                                                          <div class="" style=""><br clear="none" class="" style="">
                                                          </div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;">I
                                                          want to create
                                                          a plugin that
                                                          makes some
                                                          changes on the
                                                          parsed AST and
                                                          that directly
                                                          compiles the
                                                          changes made
                                                          on the AST. It
                                                          is important
                                                          that I do not
                                                          generate a new
                                                          file with the
                                                          changes on the
                                                          AST.</div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;">So,
                                                          in other
                                                          words, I want
                                                          to change the
                                                          AST in place,
                                                          and then
                                                          compile it in
                                                          the same run,
                                                          using a Clang
                                                          Plugin.</div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                                          </div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;">I
                                                          am using llvm
                                                          3.4.2.</div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                                          </div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="font-size:12pt;">By following the
                                                          RecursiveASTVisitor
                                                          example, </span>I
                                                          have written a
                                                          clang plugin
                                                          which modifies
                                                          the parsed
                                                          AST.</div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                                          </div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;">I
                                                          am using the
                                                          Rewriter class
                                                          to ReplaceText
                                                          inside the
                                                          buffer.</div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                                          </div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;">I
                                                          am also using
                                                          the
                                                          -add-plugin <span class="" style="font-size:12pt;">command</span><span class="" style="font-size:12pt;"> </span><span class="" style="background-color:transparent;">(instead


                                                          the "standard"
                                                          -plugin
                                                          command) when
                                                          calling the
                                                          plugin.</span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="background-color:transparent;"><br clear="none" class="" style="">
                                                          </span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="background-color:transparent;">The
                                                          rewriting part
                                                          works
                                                          excellently.
                                                          However, when
                                                          I continue the
                                                          compilation,
                                                          clang only
                                                          compiles the
                                                          original file,
                                                          instead of the
                                                          original file
                                                          + changes.</span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="background-color:transparent;">Is there a
                                                          way to tell
                                                          clang/llvm to
                                                          compile what I
                                                          have written
                                                          in the AST
                                                          (using the
                                                          Rewriter)
                                                          without
                                                          creating an
                                                          intermediate
                                                          file?</span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="background-color:transparent;"><br clear="none" class="" style="">
                                                          </span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="background-color:transparent;">Thanks a lot
                                                          for your help,</span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><span class="" style="background-color:transparent;">Bogdan</span></div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                                          </div>
                                                          <div class="" style="color:rgb(0, 0, 0);font-size:16px;font-family:HelveticaNeue, 'Helvetica                                                           Neue', Helvetica, Arial, 'Lucida                                                           Grande', sans-serif;font-style:normal;background-color:transparent;"><br clear="none" class="" style="">
                                                          </div>
                                                          </div>
                                                          </div>
                                                          <br clear="none" class="" style="">
                                                          <fieldset class="" style=""></fieldset>
                                                          <br clear="none" class="" style="">
                                                          <pre class="" style="">_______________________________________________
cfe-dev mailing list
<a rel="nofollow" shape="rect" class="" ymailto="mailto:cfe-dev@cs.uiuc.edu" target="_blank" href="mailto:cfe-dev@cs.uiuc.edu" style="">cfe-dev@cs.uiuc.edu</a>
<a rel="nofollow" shape="rect" class="" target="_blank" href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" style="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a>
</pre>
                                                          <br clear="none" class="" style="">
                                                          </div>
                                                          </div>
                                                          <br clear="none" class="" style="">
                                                          <br clear="none" class="" style="">
                                                          </div>
                                                          </div>
                                                          </div>
                                                          </div>
                                                        </div>
                                                        <br clear="none" class="" style="">
                                                      </div>
                                                    </div>
                                                  </div>
                                                  <br clear="none" class="" style="">
                                                  <br clear="none" class="" style="">
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </blockquote>
                                      <br clear="none" class="" style="">
                                    </div>
                                  </div>
                                </div>
                                <br clear="none" class="" style="">
                                <br clear="none" class="" style="">
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <br clear="none" class="" style="">
                <br clear="none" class="" style="">
              </div>
            </div>
          </div>
        </div>
      </div>
    
    <br clear="none" class="" style="">
  </div></div></div><br clear="none" class="" style=""><br clear="none" class="" style=""></div>  </div> </div>  </div></div> </div></div></div></div></body></html>