<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 29, 2014 at 2:26 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Jan 29, 2014 at 2:23 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br>

><br>
><br>
><br>
> On Wed, Jan 29, 2014 at 2:06 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Author: echristo<br>
>> Date: Wed Jan 29 16:06:27 2014<br>
>> New Revision: 200422<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=200422&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=200422&view=rev</a><br>
>> Log:<br>
>> Turn on CU ranges if we've got multiple compile units in the same<br>
>> module since there's no range guarantee that we could make given<br>
>> output order. This also fixes up the testcases that have multiple<br>
>> CUs to have the correct range offset.<br>
><br>
><br>
> What if LTO together a debug and non-debug module together? We'll still have<br>
> one CU, but we'll have functions that aren't in that CU - and incorrectly<br>
> describe that using an "all text" range?<br>
><br>
<br>
</div>... Short of saying "always use DW_AT_ranges" I don't have a good<br>
solution for this. I'm somewhat down with that, but...<br></blockquote><div><br></div><div>Perhaps you were addressing this with the "there's no range guarantee that we could make given output order" (I'm not /quite/ sure how to parse that sentence) - but I thought we'd settled on the idea that we could rely on output order and just coalesce functions/ranges that came one after the other. Or did you come up with some cases that breaks down for/that we care about?<br>
<br>That way we'd still get high/low whenever it's contiguous, and otherwise we'd use ranges.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<span class="HOEnZb"><font color="#888888"><br>
-eric<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
>><br>
>><br>
>> Modified:<br>
>>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
>>     llvm/trunk/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll<br>
>><br>
>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=200422&r1=200421&r2=200422&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=200422&r1=200421&r2=200422&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Wed Jan 29 16:06:27<br>
>> 2014<br>
>> @@ -1119,10 +1119,12 @@ void DwarfDebug::endSections() {<br>
>>    }<br>
>><br>
>>    // For now only turn on CU ranges if we've explicitly asked for it,<br>
>> -  // we have -ffunction-sections enabled, or we've emitted a function<br>
>> -  // into a unique section. At this point all sections should be<br>
>> finalized<br>
>> -  // except for dwarf sections.<br>
>> -  HasCURanges = DwarfCURanges || UsedNonDefaultText ||<br>
>> +  // we have -ffunction-sections enabled, we've emitted a function<br>
>> +  // into a unique section, or we're using LTO. If we're using LTO then<br>
>> +  // we can't know that any particular function in the module is<br>
>> correlated<br>
>> +  // to a particular CU and so we need to be conservative. At this point<br>
>> all<br>
>> +  // sections should be finalized except for dwarf sections.<br>
>> +  HasCURanges = DwarfCURanges || UsedNonDefaultText || (CUMap.size() > 1)<br>
>> ||<br>
>>                  TargetMachine::getFunctionSections();<br>
>>  }<br>
>><br>
>><br>
>> Modified:<br>
>> llvm/trunk/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll?rev=200422&r1=200421&r2=200422&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll?rev=200422&r1=200421&r2=200422&view=diff</a><br>

>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll<br>
>> (original)<br>
>> +++ llvm/trunk/test/DebugInfo/X86/stmt-list-multiple-compile-units.ll Wed<br>
>> Jan 29 16:06:27 2014<br>
>> @@ -8,11 +8,11 @@<br>
>>  ; CHECK: .debug_info contents:<br>
>>  ; CHECK: DW_TAG_compile_unit<br>
>>  ; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset]   (0x00000000)<br>
>> -; CHECK: DW_AT_low_pc [DW_FORM_addr]       (0x0000000000000000)<br>
>> +; CHECK: DW_AT_ranges [DW_FORM_sec_offset]      (0x00000000)<br>
>><br>
>>  ; CHECK: DW_TAG_compile_unit<br>
>>  ; CHECK: DW_AT_stmt_list [DW_FORM_sec_offset]   (0x0000003c)<br>
>> -; CHECK: DW_AT_low_pc [DW_FORM_addr]       (0x0000000000000000)<br>
>> +; CHECK: DW_AT_ranges [DW_FORM_sec_offset]      (0x00000020)<br>
>><br>
>>  ; CHECK: .debug_line contents:<br>
>>  ; CHECK-NEXT: Line table prologue:<br>
>> @@ -25,12 +25,12 @@<br>
>><br>
>>  ; DWARF3: .debug_info contents:<br>
>>  ; DWARF3: DW_TAG_compile_unit<br>
>> -; DWARF3: DW_AT_stmt_list [DW_FORM_data4]   (0x00000000)<br>
>> -; DWARF3: DW_AT_low_pc [DW_FORM_addr]       (0x0000000000000000)<br>
>> +; DWARF3: DW_AT_stmt_list [DW_FORM_data4]    (0x00000000)<br>
>> +; DWARF3: DW_AT_ranges [DW_FORM_data4]       (0x00000000)<br>
>><br>
>>  ; DWARF3: DW_TAG_compile_unit<br>
>>  ; DWARF3: DW_AT_stmt_list [DW_FORM_data4]   (0x0000003c)<br>
>> -; DWARF3: DW_AT_low_pc [DW_FORM_addr]       (0x0000000000000000)<br>
>> +; DWARF3: DW_AT_ranges [DW_FORM_data4]      (0x00000020)<br>
>><br>
>>  ; DWARF3: .debug_line contents:<br>
>>  ; DWARF3-NEXT: Line table prologue:<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>
><br>
><br>
</div></div></blockquote></div><br></div></div>