patch-r261991-llvm-r198385-fix-dwarf2.diff revision 269012
1Pull in r198385 from upstream llvm trunk (by David Blaikie): 2 3 Reverting r193835 due to weirdness with Go... 4 5 Apologies for the noise - we're seeing some Go failures with cgo 6 interacting with Clang's debug info due to this change. 7 8Introduced here: http://svnweb.freebsd.org/changeset/base/261991 9 10Index: lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp 11=================================================================== 12--- lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp 13+++ lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp 14@@ -1845,9 +1845,6 @@ void CompileUnit::constructMemberDIE(DIE &Buffer, 15 16 addSourceLine(MemberDie, DT); 17 18- DIEBlock *MemLocationDie = new (DIEValueAllocator) DIEBlock(); 19- addUInt(MemLocationDie, dwarf::DW_FORM_data1, dwarf::DW_OP_plus_uconst); 20- 21 if (DT.getTag() == dwarf::DW_TAG_inheritance && DT.isVirtual()) { 22 23 // For C++, virtual base classes are not at fixed offset. Use following 24@@ -1892,7 +1889,11 @@ void CompileUnit::constructMemberDIE(DIE &Buffer, 25 } else 26 // This is not a bitfield. 27 OffsetInBytes = DT.getOffsetInBits() >> 3; 28- addUInt(MemberDie, dwarf::DW_AT_data_member_location, None, OffsetInBytes); 29+ 30+ DIEBlock *MemLocationDie = new (DIEValueAllocator) DIEBlock(); 31+ addUInt(MemLocationDie, dwarf::DW_FORM_data1, dwarf::DW_OP_plus_uconst); 32+ addUInt(MemLocationDie, dwarf::DW_FORM_udata, OffsetInBytes); 33+ addBlock(MemberDie, dwarf::DW_AT_data_member_location, MemLocationDie); 34 } 35 36 if (DT.isProtected()) 37Index: test/DebugInfo/X86/data_member_location.ll 38=================================================================== 39--- test/DebugInfo/X86/data_member_location.ll 40+++ test/DebugInfo/X86/data_member_location.ll 41@@ -11,11 +11,11 @@ 42 43 ; CHECK: DW_AT_name {{.*}} "c" 44 ; CHECK-NOT: DW_TAG 45-; CHECK: DW_AT_data_member_location {{.*}} (0x00) 46+; CHECK: DW_AT_data_member_location {{.*}} (<0x02> 23 00 ) 47 48 ; CHECK: DW_AT_name {{.*}} "i" 49 ; CHECK-NOT: DW_TAG 50-; CHECK: DW_AT_data_member_location {{.*}} (0x04) 51+; CHECK: DW_AT_data_member_location {{.*}} (<0x02> 23 04 ) 52 53 %struct.foo = type { i8, i32 } 54 55Index: test/DebugInfo/X86/concrete_out_of_line.ll 56=================================================================== 57--- test/DebugInfo/X86/concrete_out_of_line.ll 58+++ test/DebugInfo/X86/concrete_out_of_line.ll 59@@ -7,7 +7,7 @@ 60 ; first check that we have a TAG_subprogram at a given offset and it has 61 ; AT_inline. 62 63-; CHECK: 0x0000011c: DW_TAG_subprogram [17] 64+; CHECK: 0x0000011e: DW_TAG_subprogram [17] 65 ; CHECK-NEXT: DW_AT_specification 66 ; CHECK-NEXT: DW_AT_inline 67 68@@ -14,8 +14,8 @@ 69 70 ; and then that a TAG_subprogram refers to it with AT_abstract_origin. 71 72-; CHECK: 0x0000015d: DW_TAG_subprogram [19] 73-; CHECK-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x011c => {0x0000011c}) 74+; CHECK: 0x0000015f: DW_TAG_subprogram [19] 75+; CHECK-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x011e => {0x0000011e}) 76 77 define i32 @_ZN17nsAutoRefCnt7ReleaseEv() { 78 entry: 79Index: test/DebugInfo/X86/generate-odr-hash.ll 80=================================================================== 81--- test/DebugInfo/X86/generate-odr-hash.ll 82+++ test/DebugInfo/X86/generate-odr-hash.ll 83@@ -1,5 +1,8 @@ 84 ; REQUIRES: object-emission 85 86+; Fail while investigating problem with non-block representations of member offsets. 87+; XFAIL: * 88+ 89 ; RUN: llc %s -o %t -filetype=obj -O0 -generate-odr-hash -mtriple=x86_64-unknown-linux-gnu 90 ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s 91 ; 92