summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2017-09-07 22:15:44 +0000
committerPaul Robinson <paul.robinson@sony.com>2017-09-07 22:15:44 +0000
commitbb921370809f6d297108b7efac4df7fb9051128b (patch)
treee5d155cb204aee4dfce4e614971d2455b3b85440 /llvm/lib
parent6aa34aadd162093fe3aada3d3724ea30a143b3db (diff)
downloadbcm5719-llvm-bb921370809f6d297108b7efac4df7fb9051128b.tar.gz
bcm5719-llvm-bb921370809f6d297108b7efac4df7fb9051128b.zip
[DWARF] Line 0 should not have a discriminator.
It's meaningless and takes up extra space in the line table. Differential Revision: https://reviews.llvm.org/D37364 llvm-svn: 312751
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 8b2b044a397..e44ad4ea302 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1362,8 +1362,8 @@ void DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, const MDNode *S,
if (auto *Scope = cast_or_null<DIScope>(S)) {
Fn = Scope->getFilename();
Dir = Scope->getDirectory();
- if (auto *LBF = dyn_cast<DILexicalBlockFile>(Scope))
- if (getDwarfVersion() >= 4)
+ if (Line != 0 && getDwarfVersion() >= 4)
+ if (auto *LBF = dyn_cast<DILexicalBlockFile>(Scope))
Discriminator = LBF->getDiscriminator();
unsigned CUID = Asm->OutStreamer->getContext().getDwarfCompileUnitID();
OpenPOWER on IntegriCloud