<div dir="ltr">Thanks Adrian.<div><br></div><div>The ASan issue in that code review actually seems very similar to some of the global variable manipulation that I'm doing as part of whole-program vtable optimization and CFI (see e.g. DevirtModule::rebuildGlobal). I'll have to think about whether there's maybe some solution to this problem that could be used by ASan, vtable opt and CFI.<div class="gmail_extra"><br></div><div class="gmail_extra">How can we end up with more than one !dbg per global? Because of global merging?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Peter</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Fri, May 6, 2016 at 1:30 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">You have my full support! I actually started implementing this to fix the problem outlined in <a href="http://reviews.llvm.org/D18109" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18109</a>, but then was side-tracked by some ThinLTO work. I’ve attached my early stage WIP patch to the D18109, in case you are interested in looking at it and/or picking up from there. There are some interesting challenges, such as the fact that we need to support more than one !dbg attachement per global and the need to replace constants in the global field with DIExpressions that I haven’t tackled yet.<br>
<br>
-- adrian<br>
<div><div class="h5"><br>
<br>
> On May 6, 2016, at 1:17 PM, Peter Collingbourne via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> I'd like to add support for metadata attachments for global variables in the same way as we did for functions.<br>
><br>
> Syntax would be pretty simple:<br>
> @foo = global i32 0, !foo !0, !bar !1<br>
> (the extra commas are required to disambiguate from a named metadata on the next line)<br>
><br>
> Benefits:<br>
> 1) Lets us reverse the DIGlobalVariable -> GlobalVariable edge, which should hopefully clear the way for removing the <a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a> named metadata node.<br>
><br>
> 2) Allows for bitset metadata to be attached to globals rather than being represented as a named metadata node. This means that bitset metadata is naturally dropped when globals are dropped, and makes it easier to manipulate bitset metadata and build summaries of bitset definitions.<br>
><br>
> Comments appreciated.<br>
><br>
> Thanks,<br>
> --<br>
> --<br>
> Peter<br>
</div></div>> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div></div></div>