<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 25, 2013, at 5:14 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 25, 2013 at 5:02 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.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 Feb 25, 2013, at 4:55 PM, Adrian Prantl <<a href="mailto:aprantl@apple.com">aprantl@apple.com</a>> wrote:<br>

> here’s another patch for review:<br>
><br>
> Allocate stack storage for .block_descriptor and captured self.<br>
> This way the register allocator will not optimize away the the<br>
> debug info for captured variables.<br>
<br>
</div>Allocating stack storage is not the right way to fix this problem.<br>
The frontend is emitting the right intrinsics to say that the argument<br>
is being kept in an LLVM value, not in memory.  If that's not working,<br>
then basically all optimized debug info is useless.<br><br></blockquote><div><br></div><div style="">That's pretty accurate. The backend in a lot of places is depending upon an</div><div style="">alloca existing in order to get a location for a variable. To make optimized</div>
<div style="">debug info work we're going to need to fix that assumption.</div></div></div></div></blockquote><br></div><div>When did this become true?  I know that at least *some* debugging used</div><div>to work in blocks, and we haven't been making allocas for them in a while.</div><div>Maybe it was a really brittle, but some things used to survive at least to the</div><div>point that GDB could consume them.</div><div><br></div><div>If we *must* do this as a temporary debug info workaround, then the</div><div>appropriate solution for things like the block descriptor is to make the</div><div>alloca, slam a value into it, and use that for the debug info intrinsic, but</div><div>not otherwise change IR-generation for the function.</div><div><br></div><div>John.</div><br></body></html>