summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2018-03-01 00:12:35 +0000
committerPaul Robinson <paul.robinson@sony.com>2018-03-01 00:12:35 +0000
commit1e0116c91dbd44574f4f22dc0646203d6cd159f6 (patch)
tree5e185b9b4ca2c52be394df999b8ca59b4de334bb
parentcb9611ca67f7657dcfbe44aac0cb01a6c0a54c80 (diff)
downloadbcm5719-llvm-1e0116c91dbd44574f4f22dc0646203d6cd159f6.tar.gz
bcm5719-llvm-1e0116c91dbd44574f4f22dc0646203d6cd159f6.zip
[DWARF] Emit a split line table only if there are split type units.
A .debug_info.dwo section doesn't use the .debug_line.dwo section. llvm-svn: 326395
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp3
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h4
-rw-r--r--llvm/test/DebugInfo/Generic/empty.ll2
3 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index a9aa00cefc1..3a755306669 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -2105,6 +2105,8 @@ void DwarfDebug::emitDebugAbbrevDWO() {
void DwarfDebug::emitDebugLineDWO() {
assert(useSplitDwarf() && "No split dwarf?");
+ if (!HasSplitTypeUnits)
+ return;
Asm->OutStreamer->SwitchSection(
Asm->getObjFileLowering().getDwarfLineDWOSection());
SplitTypeUnitFileTable.Emit(*Asm->OutStreamer, MCDwarfLineTableParams());
@@ -2220,6 +2222,7 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
InfoHolder.computeSizeAndOffsetsForUnit(TU.first.get());
InfoHolder.emitUnit(TU.first.get(), useSplitDwarf());
}
+ HasSplitTypeUnits = useSplitDwarf();
}
CU.addDIETypeSignature(RefDie, Signature);
}
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 46d644657a8..e1de946f6f4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -274,6 +274,10 @@ class DwarfDebug : public DebugHandlerBase {
/// a monolithic sequence of string offsets.
bool UseSegmentedStringOffsetsTable;
+ /// Whether we have emitted any type units with split DWARF (and therefore
+ /// need to emit a line table to the .dwo file).
+ bool HasSplitTypeUnits = false;
+
/// Separated Dwarf Variables
/// In general these will all be for bits that are left in the
/// original object file, rather than things that are meant
diff --git a/llvm/test/DebugInfo/Generic/empty.ll b/llvm/test/DebugInfo/Generic/empty.ll
index aeb4726ecfe..dd1e2752b31 100644
--- a/llvm/test/DebugInfo/Generic/empty.ll
+++ b/llvm/test/DebugInfo/Generic/empty.ll
@@ -16,7 +16,9 @@
; CHECK: contents:
; Don't emit DW_AT_addr_base when there are no addresses.
+; Also don't emit a split line table when there are no type units.
; FISSION-NOT: DW_AT_GNU_addr_base [DW_FORM_sec_offset]
+; FISSION-NOT: .debug_line.dwo contents:
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!5}
OpenPOWER on IntegriCloud