diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-02-14 01:57:59 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-02-14 01:57:59 +0000 |
commit | 177585d1d9bfb1589b5281148bd6c6e2f09f66a3 (patch) | |
tree | 6bf4594e09b940425a71b70342c64590525bea7d /llvm/lib/MC | |
parent | 0d403d22b0a62ce5588276d042c91b840a0f7eab (diff) | |
download | bcm5719-llvm-177585d1d9bfb1589b5281148bd6c6e2f09f66a3.tar.gz bcm5719-llvm-177585d1d9bfb1589b5281148bd6c6e2f09f66a3.zip |
DebugInfo: Don't include the name of the CU file in the line table file list when it's unneeded
Recommitting r201351 and r201355 (reverted in r201351 and r201355)
We weren't emitting the an empty (header only) line table when the line
table was empty - this made the DWARF invalid (the compile unit would
point to the zero-size debug_lines section where there should've been an
empty line table but there was nothing at all). Fix that, and as a
consequence this works around/addresses PR18809.
llvm-svn: 201380
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r-- | llvm/lib/MC/MCObjectStreamer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index f00231e3d31..bfa3c8cfa34 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -379,7 +379,8 @@ void MCObjectStreamer::EmitZeros(uint64_t NumBytes) { void MCObjectStreamer::FinishImpl() { // Dump out the dwarf file & directory tables and line tables. const MCSymbol *LineSectionSymbol = NULL; - if (getContext().hasDwarfFiles()) + if (!getContext().getMCLineTableSymbols().empty() || + getContext().hasDwarfFiles()) LineSectionSymbol = MCDwarfFileTable::Emit(this); // If we are generating dwarf for assembly source files dump out the sections. |