[llvm] r174785 - Dwarf: do not use line_table_start in at_stmt_list since we do not always emit

Manman Ren mren at apple.com
Mon Feb 11 10:49:46 PST 2013


On Feb 8, 2013, at 5:08 PM, Eric Christopher <echristo at gmail.com> wrote:

> 
> 
> +  // The line table entries are not always emitted in assembly, so it
> +  // is not okay to use line_table_start here.
>    if (Asm->MAI->doesDwarfUseRelocationsAcrossSections())
>      NewCU->addLabel(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4,
> -                    LineTableStartSym);
> +                    NewCU->getUniqueID() == 0 ?
> +                    Asm->GetTempSymbol("section_line") : LineTableStartSym);
> 
> This is why I was worried about always conditionalizing on ID 0, is there some way we can avoid this?

We can get rid of accessing line_table_start for the first compile unit, but not the other compile units.
If the line_table_start symbols are not emitted in the assembly file, we will have undefined labels.
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. 
> 
> Also, there's a cached symbol for the beginning of the section. Please use it as it is a few lines below :)

Will do.

Thanks,
Manman
> 
> -eric
>  
>    else if (NewCU->getUniqueID() == 0)
>      NewCU->addUInt(Die, dwarf::DW_AT_stmt_list, dwarf::DW_FORM_data4, 0);
>    else
> 
> Modified: llvm/trunk/test/DebugInfo/X86/stmt-list.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stmt-list.ll?rev=174785&r1=174784&r2=174785&view=diff
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/X86/stmt-list.ll (original)
> +++ llvm/trunk/test/DebugInfo/X86/stmt-list.ll Fri Feb  8 18:41:44 2013
> @@ -3,7 +3,7 @@
>  ; CHECK:      .section        .debug_line,"", at progbits
>  ; CHECK-NEXT: .Lsection_line:
> 
> -; CHECK:      .long .Lline_table_start0 # DW_AT_stmt_list
> +; CHECK:      .long   .Lsection_line          # DW_AT_stmt_list
> 
>  define void @f() {
>  entry:
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130211/7c569ce1/attachment.html>


More information about the llvm-commits mailing list