<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 15, 2016 at 7:22 AM, Duncan P. N. Exon Smith via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@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"><span class=""><br>
> On 2016-Jan-15, at 06:46, Keno Fischer <<a href="mailto:kfischer@college.harvard.edu">kfischer@college.harvard.edu</a>> wrote:<br>
><br>
> Looking at this again, I think I was under the mistaken impression that the DISubprogram's scope would have to be the compile unit, but it seems we also currently allow it to be a DIFile (or any other kind of scope). In that case, I suppose the behavior that the backend expects is that every DISubprogram is referenced from some DICompileUnit contained in <a href="http://llvm.dbg.cu" rel="noreferrer" target="_blank">llvm.dbg.cu</a>. I'll implement a Verifier pass to that extent.<br>
<br>
</span>Two things I remember:<br>
1. There's difference between subprogram definitions and subprogram declarations.  Declarations seem to just be part of the type hierarchy.<br>
2. Subprogram definitions need to be referenced from the compile units.<br>
<br>
IMO this link (2) should be reversed:  we should reference compile units from subprogram definitions (through a new cu: field) and drop the reference in the other direction.  This would be far more convenient for LTO (or llvm-link in general), but it causes a semantic change and I never worked through the implications of that.<br></blockquote><div><br></div><div>I'd probably be OK with that.<br><br>Though I will note that I don't /think/ (2) is true right now, and I think we actually violate (2) intentionally, perhaps.<br><br>Diego: To include line/col info for backend diagnostics, we produced debug info but omitted the <a href="http://llvm.dbg.cu">llvm.dbg.cu</a> entry, right? So there are subprogram debug info descriptions that are not referenced from a CU in <a href="http://llvm.dbg.cu">llvm.dbg.cu</a>, yes?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=""><br>
> On Fri, Jan 15, 2016 at 4:26 AM, Keno Fischer <<a href="mailto:kfischer@college.harvard.edu">kfischer@college.harvard.edu</a>> wrote:<br>
> I'm looking at cases of disagreement between assertions in the backend and what the Verifier checks for (for <a href="http://reviews.llvm.org/D16083" rel="noreferrer" target="_blank">http://reviews.llvm.org/D16083</a>). One of these seems to be the question of whether a DISuprogram may exist without a DICompileUnit. Currently the Verifier doesn't care, but there are a few assertions to this extent in the backend.<br>
> Possible options are:<br>
><br>
> 1) A DISubprogram may exist without a DICompileUnit (what would we have to change in the backend?)<br>
> 2) A DISubprogram's scope may be null, but only if there's a DICompileUnit that references it.<br>
> 3) A DISubprogram's scope may not be null, but the referenced DICompileUnit need not necessarily contain it<br>
> 4) A DISubprogram's scope may not be null, and the referenced DICompileUnit must contain it<br>
><br>
> As far as I can tell, all of these would need some amount of changes to either existing code or existing test cases.<br>
><br>
<br>
</span>_______________________________________________<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>
</blockquote></div><br></div></div>