[llvm] r203309 - Remove unnecessary test for Darwin and update testcase to be a little less

Adrian Prantl aprantl at apple.com
Fri Jun 13 14:00:47 PDT 2014


> On Jun 13, 2014, at 1:48 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> On Fri, Mar 7, 2014 at 3:07 PM, Adrian Prantl <aprantl at apple.com> wrote:
>> Author: adrian
>> Date: Fri Mar  7 17:07:21 2014
>> New Revision: 203309
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=203309&view=rev
>> Log:
>> Remove unnecessary test for Darwin and update testcase to be a little less
>> horrible/fragile.
>> rdar://problem/16264854
>> 
>> Modified:
>>    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>>    llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll
>>    llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll
>> 
>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=203309&r1=203308&r2=203309&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Mar  7 17:07:21 2014
>> @@ -2845,7 +2845,7 @@ void DwarfDebug::addDwarfTypeUnitType(Dw
>> void DwarfDebug::attachLowHighPC(DwarfCompileUnit *Unit, DIE *D,
>>                                  MCSymbol *Begin, MCSymbol *End) {
>>   Unit->addLabelAddress(D, dwarf::DW_AT_low_pc, Begin);
>> -  if (DwarfVersion < 4 || Triple(Asm->getTargetTriple()).isOSDarwin())
>> +  if (DwarfVersion < 4)
>>     Unit->addLabelAddress(D, dwarf::DW_AT_high_pc, End);
>>   else
>>     Unit->addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin);
>> 
>> Modified: llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll?rev=203309&r1=203308&r2=203309&view=diff
>> ==============================================================================
>> --- llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll (original)
>> +++ llvm/trunk/test/DebugInfo/X86/dbg-value-inlined-parameter.ll Fri Mar  7 17:07:21 2014
>> @@ -8,8 +8,7 @@
>> ;CHECK: DW_TAG_inlined_subroutine
>> ;CHECK-NEXT: DW_AT_abstract_origin
>> ;CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr]
>> -;DARWIN-NEXT: DW_AT_high_pc [DW_FORM_addr]
>> -;LINUX-NEXT: DW_AT_high_pc [DW_FORM_data4]
>> +;CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4]
>> ;CHECK-NEXT: DW_AT_call_file
>> ;CHECK-NEXT: DW_AT_call_line
>> 
>> 
>> Modified: llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll?rev=203309&r1=203308&r2=203309&view=diff
>> ==============================================================================
>> --- llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll (original)
>> +++ llvm/trunk/test/DebugInfo/X86/dbg-value-location.ll Fri Mar  7 17:07:21 2014
>> @@ -1,14 +1,16 @@
>> -; RUN: llc < %s | FileCheck %s
>> -; RUN: llc < %s -regalloc=basic | FileCheck %s
>> +; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
>> +; RUN: llc -filetype=obj %s -regalloc=basic -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
>> target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
>> target triple = "x86_64-apple-darwin10.0.0"
>> -;Radar 8950491
>> +; Test that the type for the formal parameter "var" makes it into the debug info.
> 
> I don't think this was the intended purpose of this test, judging by
> the original commit message in r124845. Though the rdar may have more
> information that I'm not privy to.
> 
> The original commit message was:
> 
> "DebugLoc associated with a machine instruction is used to emit
> location entries. DebugLoc associated with a DBG_VALUE is used to
> identify lexical scope of the variable. After register allocation,
> while inserting DBG_VALUE remember original debug location for the
> first instruction and reuse it, otherwise dwarf writer may be mislead
> in identifying the variable's scope."
> 
> Judging by that, while I am a little confused how this test relates to
> that "mislead in identifying the variable's scope", I /think/ the test
> was trying to test that the formal parameter has a file and line?

>From the radar it looks like before r124845 the backend would emit a (wrong) DW_AT_abstract_origin and neither type nor file/line.

> Honestly it seems more like the test probably wanted to ensure the
> parameter was at the top level scope, or had some specific file/line,
> but I don't really know...
> 
> CHECK: DW_TAG_formal_parameter
> CHECK-NOT: DW_TAG
> CHECK:   DW_AT_name {{.*}} "var"
> CHECK-NOT: DW_TAG
> CHECK:   DW_AT_file
> CHECK-NOT: DW_TAG
> CHECK:   DW_AT_line
> 
> (this also happens to make this test compatible with a change I'm
> about to make that would cause the DW_AT_location to go from being the
> last attribute to being the first - I don't think this test needs to
That sounds like a painful change. What’s the motivation?

> be examining the DW_AT_location at all, so it shouldn't be affected by
> that change)

So what we need to preserve in this test is that the variable has type/line/file, obviously the exact order of those attributes is irrelevant. We could add a CHECK-NOT: DW_AT_abstract_origin.

> 
> And update the comment to describe something related to the original
> commit message.
> 
> Or we could just delete the test...

Deleting a test because we don’t fully understand it is never the right thing :-)

-- adrian

> 
>> +; rdar://8950491
>> 
>> -;CHECK: .long Lset5
>> -;CHECK-NEXT:        ## DW_AT_decl_file
>> -;CHECK-NEXT:        ## DW_AT_decl_line
>> -;CHECK-NEXT:        ## DW_AT_type
>> -;CHECK-NEXT:        ## DW_AT_location
>> +;CHECK: DW_TAG_formal_parameter
>> +;CHECK-NEXT: DW_AT_name {{.*}} "var"
>> +;CHECK-NEXT: DW_AT_decl_file
>> +;CHECK-NEXT: DW_AT_decl_line
>> +;CHECK-NEXT: DW_AT_type
>> +;CHECK-NEXT: DW_AT_location
>> 
>> @dfm = external global i32, align 4
>> 
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list