<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><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 class="HOEnZb"><div class="h5"><br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">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>