<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 6, 2016 at 8:44 AM, 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Apr 6, 2016, at 8:16 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br><div><br><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">On Tue, Apr 5, 2016 at 10:17 PM, Eric Christopher via llvm-commits<span> </span><span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span><span> </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">echristo added inline comments.<br><br>================<br>Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:477-479<br>@@ -476,2 +476,5 @@<br>+  unsigned DebugCUs = 0;<br>   for (MDNode *N : CU_Nodes->operands()) {<br>     auto *CUNode = cast<DICompileUnit>(N);<br>+    if (CUNode->getEmissionKind() == DICompileUnit::NoDebug)<br>+      continue;<br>----------------<br>Instead of this pattern would it make more sense to have an iterator over the nodes that checks for !NoDebug?<br></blockquote><div><br></div><div>Yeah, that sounds like something that might be nice.<br><br>Adrian - I recall one of your initial ideas was to just have a different named metadata node for these subprograms. </div></div></div></blockquote><div><br></div></span><div>Huh. I think I had this idea in the context of collectDeadVariables (to collect dead subprograms), but I see how it would apply here, too.</div><span class=""><div><div><br></div></div><blockquote type="cite"><div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div>What was the motivation for not going with that plan? (which would've meant these sort of loops would've remained OK, and only the loops in the verifier and such would need to examine both nodes?) Perhaps this relates to your comment about LTOing debug+nodebug CUs? I didn't quite follow what was wrong with that in the first place & how this addresses it, could you explain it?<br></div></div></div></blockquote><div><br></div></span><div>Most of the patches I’ve been committing recently are in preparation reversing the ownership between DICompileUnit and DISubprogram (which will help ThinLTO to lazy-load debug info).</div><div>DICompileUnit will no longer have a list of “subprograms:" and instead each DISubprogram will have a “unit:" field that points to the owning CU.</div><div><br></div><div>While it would be possible to leave the unit field empty and have a NamedMDNode hold on to these subprograms, having a mandatory “unit:" point to a CU that is explicitly marked NoDebug is a more regular and readable representation. It’s straightforward to verify and easier to debug especially in the LTO case.</div></div></div></blockquote><div><br></div><div>Not sure whether it adds much more regularity or irregularity compared to having a null unit for the subprogram, really?<br><br>Anyone looking at the subprogram for debug purposes is going to have to walk up and check that it's not a nodebug CU, the CU isn't really a CU (when looking at the code/IR/etc - it'll be a weird construct)... but I dunno.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- adrian</div></font></span><span class=""><br><blockquote type="cite"><div><div class="gmail_quote" style="font-family:Helvetica;font-size:12px;font-style:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div> </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>================<br>Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1127-1128<br>@@ -1115,3 +1126,4 @@<br>   if (!MMI->hasDebugInfo() || LScopes.empty() ||<br>-      !MF->getFunction()->getSubprogram()) {<br>+      !MF->getFunction()->getSubprogram() ||<br>+      !SPMap.lookup(MF->getFunction()->getSubprogram())) {<br>     // If we don't have a lexical scope for this function then there will<br>----------------<br>Comment.<br><span><br><br>Repository:<br> <span> </span>rL LLVM<br><br><a href="http://reviews.llvm.org/D18808" rel="noreferrer" target="_blank">http://reviews.llvm.org/D18808</a><br><br><br><br></span><div><div>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org" target="_blank">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></div></div></blockquote></div></div></blockquote></span></div><br></div></blockquote></div><br></div></div>