[llvm] r346674 - [DWARFv5] Emit split type units in .debug_info.dwo.

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 08:55:11 PST 2018


Author: probinson
Date: Mon Nov 12 08:55:11 2018
New Revision: 346674

URL: http://llvm.org/viewvc/llvm-project?rev=346674&view=rev
Log:
[DWARFv5] Emit split type units in .debug_info.dwo.

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

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/test/CodeGen/X86/dwarf-headers.ll
    llvm/trunk/test/CodeGen/X86/dwarf-split-line-1.ll
    llvm/trunk/test/CodeGen/X86/dwarf-split-line-2.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=346674&r1=346673&r2=346674&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Nov 12 08:55:11 2018
@@ -2609,10 +2609,13 @@ void DwarfDebug::addDwarfTypeUnitType(Dw
   NewTU.setTypeSignature(Signature);
   Ins.first->second = Signature;
 
-  if (useSplitDwarf())
-    // FIXME: v5 split type units belong in .debug_info.dwo.
-    NewTU.setSection(Asm->getObjFileLowering().getDwarfTypesDWOSection());
-  else {
+  if (useSplitDwarf()) {
+    MCSection *Section =
+        getDwarfVersion() <= 4
+            ? Asm->getObjFileLowering().getDwarfTypesDWOSection()
+            : Asm->getObjFileLowering().getDwarfInfoDWOSection();
+    NewTU.setSection(Section);
+  } else {
     MCSection *Section =
         getDwarfVersion() <= 4
             ? Asm->getObjFileLowering().getDwarfTypesSection(Signature)

Modified: llvm/trunk/test/CodeGen/X86/dwarf-headers.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dwarf-headers.ll?rev=346674&r1=346673&r2=346674&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/dwarf-headers.ll (original)
+++ llvm/trunk/test/CodeGen/X86/dwarf-headers.ll Mon Nov 12 08:55:11 2018
@@ -78,14 +78,11 @@
 ; O-5: 0x00000014: DW_TAG_compile_unit
 ;
 ; 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: 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'

Modified: llvm/trunk/test/CodeGen/X86/dwarf-split-line-1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dwarf-split-line-1.ll?rev=346674&r1=346673&r2=346674&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/dwarf-split-line-1.ll (original)
+++ llvm/trunk/test/CodeGen/X86/dwarf-split-line-1.ll Mon Nov 12 08:55:11 2018
@@ -6,13 +6,13 @@
 ; RUN:     -filetype=obj -O0 -mtriple=x86_64-unknown-linux-gnu < %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: .debug_types.dwo contents:
+; CHECK: .debug_info.dwo contents:
 ; CHECK: 0x00000000: Type Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_type abbr_offset
 ; CHECK: 0x00000018: DW_TAG_type_unit
 ; CHECK-NOT: DW_AT_stmt_list
 ; CHECK-NOT: DW_AT_decl_file
+; CHECK: Compile Unit:
 ; CHECK-NOT: .debug_line.dwo
 
 ; ModuleID = 't.cpp'

Modified: llvm/trunk/test/CodeGen/X86/dwarf-split-line-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dwarf-split-line-2.ll?rev=346674&r1=346673&r2=346674&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/dwarf-split-line-2.ll (original)
+++ llvm/trunk/test/CodeGen/X86/dwarf-split-line-2.ll Mon Nov 12 08:55:11 2018
@@ -8,8 +8,7 @@
 ; RUN: llvm-dwarfdump -v %t.dwo | FileCheck %s
 
 ; Currently the no-source-location type comes out first.
-; FIXME: V5 wants type units in .debug_info.dwo not .debug_types.dwo.
-; CHECK: .debug_types.dwo contents:
+; CHECK: .debug_info.dwo contents:
 ; CHECK: 0x00000000: Type Unit: {{.*}} name = 'S'
 ; CHECK-SAME: (next unit at [[TU2:0x[0-9a-f]+]])
 ; CHECK: DW_TAG_type_unit




More information about the llvm-commits mailing list