[DWARFv5] Emit split type units in .debug_info.dwo.

Differential Revision: https://reviews.llvm.org/D54350

llvm-svn: 346674
This commit is contained in:
Paul Robinson 2018-11-12 16:55:11 +00:00
parent b2413ea9d3
commit 5b302bfc8e
4 changed files with 13 additions and 14 deletions

View File

@ -2609,10 +2609,13 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
NewTU.setTypeSignature(Signature); NewTU.setTypeSignature(Signature);
Ins.first->second = Signature; Ins.first->second = Signature;
if (useSplitDwarf()) if (useSplitDwarf()) {
// FIXME: v5 split type units belong in .debug_info.dwo. MCSection *Section =
NewTU.setSection(Asm->getObjFileLowering().getDwarfTypesDWOSection()); getDwarfVersion() <= 4
else { ? Asm->getObjFileLowering().getDwarfTypesDWOSection()
: Asm->getObjFileLowering().getDwarfInfoDWOSection();
NewTU.setSection(Section);
} else {
MCSection *Section = MCSection *Section =
getDwarfVersion() <= 4 getDwarfVersion() <= 4
? Asm->getObjFileLowering().getDwarfTypesSection(Signature) ? Asm->getObjFileLowering().getDwarfTypesSection(Signature)

View File

@ -78,14 +78,11 @@
; O-5: 0x00000014: DW_TAG_compile_unit ; O-5: 0x00000014: DW_TAG_compile_unit
; ;
; DWO-5: .debug_info.dwo contents: ; DWO-5: .debug_info.dwo contents:
; DWO-5: 0x00000000: Compile Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_compile abbr_offset
; DWO-5-SAME: DWO_id = 0xccd7e58ef8bf4aa6
; DWO-5: 0x00000014: DW_TAG_compile_unit
;
; FIXME: V5 wants type units in .debug_info.dwo not .debug_types.dwo.
; DWO-5: .debug_types.dwo contents:
; DWO-5: 0x00000000: Type Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_type abbr_offset ; DWO-5: 0x00000000: Type Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_type abbr_offset
; DWO-5: 0x00000018: DW_TAG_type_unit ; DWO-5: 0x00000018: DW_TAG_type_unit
; DWO-5: 0x00000033: Compile Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_compile abbr_offset
; DWO-5-SAME: DWO_id = 0xccd7e58ef8bf4aa6
; DWO-5: 0x00000047: DW_TAG_compile_unit
; ModuleID = 't.cpp' ; ModuleID = 't.cpp'

View File

@ -6,13 +6,13 @@
; RUN: -filetype=obj -O0 -mtriple=x86_64-unknown-linux-gnu < %s ; RUN: -filetype=obj -O0 -mtriple=x86_64-unknown-linux-gnu < %s
; RUN: llvm-dwarfdump -v %t.dwo | FileCheck %s ; RUN: llvm-dwarfdump -v %t.dwo | FileCheck %s
; FIXME: V5 wants type units in .debug_info.dwo not .debug_types.dwo.
; CHECK-NOT: .debug_line.dwo ; CHECK-NOT: .debug_line.dwo
; CHECK: .debug_types.dwo contents: ; CHECK: .debug_info.dwo contents:
; CHECK: 0x00000000: Type Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_type abbr_offset ; CHECK: 0x00000000: Type Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_type abbr_offset
; CHECK: 0x00000018: DW_TAG_type_unit ; CHECK: 0x00000018: DW_TAG_type_unit
; CHECK-NOT: DW_AT_stmt_list ; CHECK-NOT: DW_AT_stmt_list
; CHECK-NOT: DW_AT_decl_file ; CHECK-NOT: DW_AT_decl_file
; CHECK: Compile Unit:
; CHECK-NOT: .debug_line.dwo ; CHECK-NOT: .debug_line.dwo
; ModuleID = 't.cpp' ; ModuleID = 't.cpp'

View File

@ -8,8 +8,7 @@
; RUN: llvm-dwarfdump -v %t.dwo | FileCheck %s ; RUN: llvm-dwarfdump -v %t.dwo | FileCheck %s
; Currently the no-source-location type comes out first. ; Currently the no-source-location type comes out first.
; FIXME: V5 wants type units in .debug_info.dwo not .debug_types.dwo. ; CHECK: .debug_info.dwo contents:
; CHECK: .debug_types.dwo contents:
; CHECK: 0x00000000: Type Unit: {{.*}} name = 'S' ; CHECK: 0x00000000: Type Unit: {{.*}} name = 'S'
; CHECK-SAME: (next unit at [[TU2:0x[0-9a-f]+]]) ; CHECK-SAME: (next unit at [[TU2:0x[0-9a-f]+]])
; CHECK: DW_TAG_type_unit ; CHECK: DW_TAG_type_unit