<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 6, 2016, at 8:16 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Tue, Apr 5, 2016 at 10:17 PM, Eric Christopher via llvm-commits<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><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 class=""><br class="">================<br class="">Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:477-479<br class="">@@ -476,2 +476,5 @@<br class="">+  unsigned DebugCUs = 0;<br class="">   for (MDNode *N : CU_Nodes->operands()) {<br class="">     auto *CUNode = cast<DICompileUnit>(N);<br class="">+    if (CUNode->getEmissionKind() == DICompileUnit::NoDebug)<br class="">+      continue;<br class="">----------------<br class="">Instead of this pattern would it make more sense to have an iterator over the nodes that checks for !NoDebug?<br class=""></blockquote><div class=""><br class=""></div><div class="">Yeah, that sounds like something that might be nice.<br class=""><br class="">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 class=""></div><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><div><div class=""><br class=""></div></div><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="">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 class=""></div></div></div></blockquote><div><br class=""></div><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 class=""></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><br class=""></div><div>-- adrian</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""> </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 class="">================<br class="">Comment at: lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1127-1128<br class="">@@ -1115,3 +1126,4 @@<br class="">   if (!MMI->hasDebugInfo() || LScopes.empty() ||<br class="">-      !MF->getFunction()->getSubprogram()) {<br class="">+      !MF->getFunction()->getSubprogram() ||<br class="">+      !SPMap.lookup(MF->getFunction()->getSubprogram())) {<br class="">     // If we don't have a lexical scope for this function then there will<br class="">----------------<br class="">Comment.<br class=""><span class="im HOEnZb"><br class=""><br class="">Repository:<br class=""> <span class="Apple-converted-space"> </span>rL LLVM<br class=""><br class=""><a href="http://reviews.llvm.org/D18808" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D18808</a><br class=""><br class=""><br class=""><br class=""></span><div class="HOEnZb"><div class="h5">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></div></div></blockquote></div></div></blockquote></div><br class=""></body></html>