<div dir="ltr">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">llvm.dbg.cu</a>. I'll implement a Verifier pass to that extent.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 15, 2016 at 4:26 AM, Keno Fischer <span dir="ltr"><<a href="mailto:kfischer@college.harvard.edu" target="_blank">kfischer@college.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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" 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.<div>Possible options are:</div><div><br></div><div>1) A DISubprogram may exist without a DICompileUnit (what would we have to change in the backend?)</div><div>2) A DISubprogram's scope may be null, but only if there's a DICompileUnit that references it.</div><div>3) A DISubprogram's scope may not be null, but the referenced DICompileUnit need not necessarily contain it</div><div>4) A DISubprogram's scope may not be null, and the referenced DICompileUnit must contain it</div><div><br></div><div>As far as I can tell, all of these would need some amount of changes to either existing code or existing test cases.</div></div>
</blockquote></div><br></div>