<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Feb 8, 2013, at 5:08 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+  // The line table entries are not always emitted in assembly, so it<br>
+  // is not okay to use line_table_start here.<br>
   if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())<br>
     NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,<br>
-                    LineTableStartSym);<br>
+                    NewCU->getUniqueID() == 0 ?<br>
+                    Asm->GetTempSymbol("section_line") : LineTableStartSym);<br></blockquote><div><br></div><div style="">This is why I was worried about always conditionalizing on ID 0, is there some way we can avoid this?</div></div></div></div></blockquote><div><br></div>We can get rid of accessing line_table_start for the first compile unit, but not the other compile units.</div><div>If the line_table_start symbols are not emitted in the assembly file, we will have undefined labels.</div><div>The proper fix is to always emit the line_table_start symbols in assembly, but I am not aware of a way of emitting these symbols without emitting the debug line section. </div><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div style=""><br></div><div style="">Also, there's a cached symbol for the beginning of the section. Please use it as it is a few lines below :)</div></div></div></div></blockquote><div><br></div>Will do.</div><div><br></div><div>Thanks,</div><div>Manman<br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div style=""><br></div><div style="">-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

   else if (NewCU->getUniqueID() == 0)<br>
     NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);<br>
   else<br>
<br>
Modified: llvm/trunk/test/DebugInfo/X86/stmt-list.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stmt-list.ll?rev=174785&r1=174784&r2=174785&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stmt-list.ll?rev=174785&r1=174784&r2=174785&view=diff</a><br>

==============================================================================<br>
--- llvm/trunk/test/DebugInfo/X86/stmt-list.ll (original)<br>
+++ llvm/trunk/test/DebugInfo/X86/stmt-list.ll Fri Feb  8 18:41:44 2013<br>
@@ -3,7 +3,7 @@<br>
 ; CHECK:      .section        .debug_line,"",@progbits<br>
 ; CHECK-NEXT: .Lsection_line:<br>
<br>
-; CHECK:      .long .Lline_table_start0 # DW_AT_stmt_list<br>
+; CHECK:      .long   .Lsection_line          # DW_AT_stmt_list<br>
<br>
 define void @f() {<br>
 entry:<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>
</blockquote></div><br></body></html>