<div dir="ltr"><div><div><div><div><div>Hi,<br></div> While parsing the AST, I am making additions to the code. I want to find out the location of the file where global variables can be added. e.g.<br><br></div>#include <stdio.h><br>
<br></div><div>-- Want to find this location to insert global variables here<br></div><br>int main()<br>{<br>}<br> <br></div> How can I find that location. Also how does clang represent this statement "using namespace std;"?<br>
<br></div>Regards,<br>Adil<br><div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jan 3, 2013 at 3:24 AM, Argyrios Kyrtzidis <span dir="ltr"><<a href="mailto:akyrtzi@gmail.com" target="_blank">akyrtzi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Jan 2, 2013, at 12:30 PM, madil90 <<a href="mailto:madil90@gmail.com">madil90@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
> I mean once I have overridden the contents or have the new buffer<br>
> containing updated contents, how do i actually compile it? because if i<br>
> leave it at that, the program closes without doing anything. How do i<br>
> actually go forward and generate an executable of those contents.<br>
<br>
</div>A somewhat simple way would be to write the buffer to a temporary file and then just invoke the clang executable to do the compiling with the addition of passing "-remap-file" as argument.<br>
See "test/Misc/remap-file.c" for an example of such invocation.<br>
<br>
><br>
> Regards,<br>
> Adil<br>
><br>
><br>
<span class="HOEnZb"><font color="#888888">><br>
> --<br>
> View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Parse-AST-several-times-tp4029276p4029317.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Parse-AST-several-times-tp4029276p4029317.html</a><br>
</font></span><div class="HOEnZb"><div class="h5">> Sent from the Clang Developers mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mohammad Adil<div>LUMS SSE</div>
</div>