<div dir="ltr">On Thu, Jun 6, 2013 at 4:28 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="im">On Thu, Jun 6, 2013 at 4:06 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br></blockquote></div><div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


These tricks with externally-destructed aren't really suffiicient;  you need to<br>
push an EH-only cleanup for the object and then disable it when the call<br>
occurs.<br></blockquote><div><br></div></div><div>So, something like, take a stable iterator to the cleanup stack, emit the args, then delete any unnecessary cleanups?  I can't think of an easy way to identify which cleanups were passed to args and which were not.</div>
</div></div></div></blockquote><div><br></div><div style>Nevermind, that didn't make sense, I didn't really parse the EH-only cleanup part.  We need to ensure this is cleaned up on unwind.  Makes sense.</div><div>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span style="color:rgb(80,0,80)"> </span></div>
<div class="im"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
The appropriate solution here is not to propagate IsExternallyDestructed<br>
through umpteen layers of API; you'll need to check for this case specifically<br>
when emitting an argument and do all the appropriate management.</blockquote><div><br></div></div><div>I am doing the check in CodeGenFunction::EmitCallArg().  Maybe I should be propagating a bool InArgumentContext or something instead?</div>
</div></div></div></blockquote><div><br></div><div style>Given that EmitCallArg() calls through umpteen layers of API, what's the alternative to wiring a parameter through all those layers? </div></div></div></div>