<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 21, 2015 at 10:01 AM, David Majnemer <span dir="ltr"><<a href="mailto:david.majnemer@gmail.com" target="_blank">david.majnemer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think clang's delayed codegen approach is a design flaw, I'd be happy to see it gone.</blockquote><div><br></div><div>To be clear, I am in favor of delaying everything and emitting only at the end.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br><br>On Wednesday, January 21, 2015, Rafael Espíndola <<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 20 January 2015 at 12:42, David Majnemer <<a>david.majnemer@gmail.com</a>> wrote:<br>
> I don't think this approach would handle things like:<br>
><br>
> int pr22217_foo;<br>
> int *b = &pr22217_foo;<br>
> extern int pr22217_foo __asm__("pr22217_bar");<br>
><br>
> With your patch, pr22217_foo gets emitted.<br>
> With gcc, pr22217_bar gets emitted.<br>
<br>
Gosh, this part is horrible. I can see two options:<br>
<br>
* Check in CodeGenModule::getMangledName than the name we get is the<br>
same as the cache and error if not. Very expensive. Just rejecting<br>
__asm__ after the name has been computed might have the same effect<br>
and be cheaper.<br>
<br>
* Delay all of codegen. Basically just return false from<br>
CodeGenModule::MayBeEmittedEagerly and try to avoid the order change<br>
in codegen. The more I think about it, the more this looks desirable.<br>
It should also fix pr16187 and allow us to finally cache visibility<br>
computations.<br>
<br>
Cheers,<br>
Rafael<br>
</blockquote>
</div></div></blockquote></div><br></div></div>