<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 15, 2016 at 1:42 PM, Adrian Prantl <span dir="ltr"><<a href="mailto:aprantl@apple.com" target="_blank">aprantl@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 style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Jan 15, 2016, at 1:29 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 15, 2016 at 6:54 AM, Jonathan Roelofs via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">jroelofs added a comment.<br>
<br>
@Dblaikie Not sure if my explanation was clear: I'm trying to convert the DI metadata from the kind that references a global, to the kind that references a local. </blockquote><div><br></div><div>Right</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To do that, I /think/ I need to add the dbg.declare/value to the alloca that gets's created, and delete the one that references the soon-to-be-dead global. Does /that/ seem to you to be something out of the range of things that the DI metadata scheme can cope with?<br></blockquote><div><br></div><div>The problem I'm getting at is that I think you'll end up with DWARF that doesn't make sense. You'll end up with a local variable instead of a global. Not just a global described by a local location.<br><br>Does that make sense?<br><br>DWARF:<br><br>  DW_TAG_compile_unit<br>    DW_TAG_global_variable "foo"<br>    DW_TAG_subprogram<br>      DW_TAG_variable "bar"<br>      ...<br><br>-><br><br>  DW_TAG_compile_unit<br>    DW_TAG_subprogram<br>      DW_TAG_variable "foo"<br>      DW_TAG_variable "bar"<br><br>Which isn't correct. "foo" should still be a DW_TAG_global_variable in the CU scope, its location should be a local location.<br><br>I don't think the metadata can describe this currently... - but I could be wrong.</div></div></div></div></div></blockquote><div><br></div></span><div>I don’t think it can, which is why I suggested this hack with the local variable on IRC yesterday. But, of course, it would be better to fix LLVM to support the latter.</div></div></div></blockquote><div><br></div><div>Ah, yeah - if we're going to implement this, I'm not sure turning a global into a local is a sufficiently good user experience to make it an intermediate step towards the end goal, rather than doing the work up front. I'm open to discussing it, though - I can see how it'd be an option, but just seems like a bad user experience..<br><br>- Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- adrian</div></font></span><span class=""><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
If not, do you know how to delete the DIGlobalVariable here? I started down this rabbit hole because I've got a bug where the debug info emitted into the asm references the global... which no longer exists, causing the assembler to barf on it.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D16209" rel="noreferrer" target="_blank">http://reviews.llvm.org/D16209</a><br>
<div><div><br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>
</div></blockquote></span></div><br></div></blockquote></div><br></div></div>