<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 6, 2015 at 10:26 AM, Robinson, Paul <span dir="ltr"><<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.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">I'm encountering a merge issue whose root cause has to do with "distinct"<br>
metadata nodes.  I see that distinct-ness is an intentional concept, but<br>
the explanation in the LLVM Language Reference is not very enlightening.<br>
<br>
    distinct nodes are useful when nodes shouldn't be merged based on<br>
    their content.<br>
<br>
The notion of "merged" metadata is not discussed elsewhere on the page,<br>
except for Objective-C garbage collection; I'm looking at debug location<br>
metadata, so that's not relevant.<br>
<br>
I understand that distinct-ness was invented as a replacement for a<br>
self-reference hack, but that just begs the question. Why is this a<br>
useful concept?  What is it used for?  Why shouldn't certain nodes be<br>
merged based on their content?<br>
<br>
My specific issue has to do with inlined-at chains.  If I have<br>
    return inlined_func() + 1;<br>
the inlined-at chain for inlined_func() [and whatever else is inlined<br>
into inlined_func()] terminates in a node that is 'distinct' from the<br>
node for the calling statement, even though they describe the same<br>
source location.  This didn't used to be a problem, chasing the chain<br>
ended up with something that compared equal to the calling statement's<br>
source location.<br></blockquote><div><br><a href="http://llvm.org/viewvc/llvm-project?rev=226736&view=rev">http://llvm.org/viewvc/llvm-project?rev=226736&view=rev</a> is the change that caused this & has some context on why it's necessary.<br><br>The issue is that the scope change of debuglocs is how we build scopes, including inline scopes (DW_TAG_inlined_subroutine). If the call site locations aren't uniqued, then two calls from the same line to the same function would have the same location and thus be the same scope - so we'd only have one DW_TAG_inlined_subroutine, instead of two.<br><br>Clang worked around this for a while by putting column info on call sites to help give them unique call sites, but this was insufficient (the two calls could've come from within a macro, in which case they'd be attributed to the same line/column again).<br><br>- David<br> </div><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">
<br>
Thanks,<br>
--paulr<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div></div>