summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-02-14 19:51:35 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-02-14 19:51:35 +0000
commit9acebfdd94408d5477eb673b8a82887de5e5f1f0 (patch)
tree38c5c67639b6501c282564e94d971a41a30ba9b1 /llvm/lib/MC/MCObjectStreamer.cpp
parent7741101dce76de2a0d335beee596890ed0a6b507 (diff)
downloadbcm5719-llvm-9acebfdd94408d5477eb673b8a82887de5e5f1f0.tar.gz
bcm5719-llvm-9acebfdd94408d5477eb673b8a82887de5e5f1f0.zip
DebugInfo: Don't include the name of the CU file in the line table file list when it's unneeded
Recommitting r201380 (reverted in r201389) 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. Also, we emit a non-empty line table to workaround a darwin linker bug, so XFAILing on darwin too. Also, mark the test as 'REQUIRES: object-emission' because it does. llvm-svn: 201429
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp3
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.
OpenPOWER on IntegriCloud