<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 15, 2016, at 1:29 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Jan 15, 2016 at 6:54 AM, Jonathan Roelofs via llvm-commits <span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">jroelofs added a comment.<br class="">
<br class="">
@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 class=""><br class=""></div><div class="">Right</div><div class=""> </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 class=""></blockquote><div class=""><br class=""></div><div class="">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 class=""><br class="">Does that make sense?<br class=""><br class="">DWARF:<br class=""><br class="">  DW_TAG_compile_unit<br class="">    DW_TAG_global_variable "foo"<br class="">    DW_TAG_subprogram<br class="">      DW_TAG_variable "bar"<br class="">      ...<br class=""><br class="">-><br class=""><br class="">  DW_TAG_compile_unit<br class="">    DW_TAG_subprogram<br class="">      DW_TAG_variable "foo"<br class="">      DW_TAG_variable "bar"<br class=""><br class="">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 class=""><br class="">I don't think the metadata can describe this currently... - but I could be wrong.</div></div></div></div></div></blockquote><div><br class=""></div><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><br class=""></div><div>-- adrian</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
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 class="">
<br class="">
<br class="">
<a href="http://reviews.llvm.org/D16209" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D16209</a><br class="">
<div class="HOEnZb"><div class="h5"><br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>