<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 4, 2013 at 2:48 PM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@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 4 November 2013 14:37, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>

> How do you deal with the case where not all references to the aliased entity<br>
> have been generated yet?  For example:<br>
><br>
> Emit call to derived ctor<br>
> Emit derived ctor<br>
> RAUW derived ctor with base ctor<br>
> Emit call to derived ctor, create new declaration for it<br>
><br>
> I attempted this before, and this is the issue I hit.<br>
<br>
</div>This only happens for inline destructors (they are the ones that are<br>
linkonce_odr) and they are only output once at the end of the file via<br>
EmitDeferred. Were you trying to avoid aliases in more cases maybe?<br></blockquote><div><br></div><div>Why doesn't this apply to inline constructors?  They are linkonce_odr.</div><div><br></div><div>EmitDeferred has a fixpoint loop, though, so it could cause more calls to the replaced alias to be emitted.</div>
<div><br></div><div>I feel like this needs some defense against some other part of CodeGen mangling the name for the entity you are replacing and attempting to GetOrCreate it from the module.</div></div></div></div>