<div dir="ltr">Hard to say without trying.  I don't think Sema will break.  It simply calls ASTConsumer methods implemented by CodeGen, which do all the work and don't return anything back.<div><br></div><div>However, CodeGen will surely break without some cleverness on your part.  It will assume that Sema referenced and created GlobalValues for decls encountered earlier in the TU.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 11:04 PM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@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 dir="rtl"><div dir="ltr">While compiling C++ code, I'm trying to make different function and template from the same TU go into different IR modules, in order to support sort of lazy compilation with the MCJIT.</div>


<div dir="ltr"><br></div><div dir="ltr">I have tried to replace Sema CodeGen in the middle of TU. It sometimes worked but mostly crashed while running the code.</div><div dir="ltr"><br></div><div dir="ltr">It's clear that something is wrong but I am not sure if it's because it breaks something in Sema-CodeGen interface assumptions or for other reason, possibly related to MCJIT dynamic linker.</div>


<div dir="ltr"><br></div><div dir="ltr">Can I use Sema+CodeGen like that?</div><span class="HOEnZb"><font color="#888888"><div dir="ltr"><br></div><div dir="ltr">Yaron</div></font></span></div>
<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></blockquote></div><br></div>