aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/DwarfWriter.cpp
diff options
context:
space:
mode:
authorDan Gohman <djg@cray.com>2007-09-24 21:43:52 +0000
committerDan Gohman <djg@cray.com>2007-09-24 21:43:52 +0000
commitc55b34aa47482c0a83970b26a8363d16fb84b18c (patch)
tree18f32791d22ca033acdc74fb4b3764c4ae87adfc /lib/CodeGen/DwarfWriter.cpp
parent111540b8a110d125d21a800ae1b5f9a104d9a88b (diff)
downloadexternal_llvm-c55b34aa47482c0a83970b26a8363d16fb84b18c.zip
external_llvm-c55b34aa47482c0a83970b26a8363d16fb84b18c.tar.gz
external_llvm-c55b34aa47482c0a83970b26a8363d16fb84b18c.tar.bz2
Don't emit .debug_line header data if there aren't any lines to put in it,
such as will happen when .loc directives are used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DwarfWriter.cpp')
-rw-r--r--lib/CodeGen/DwarfWriter.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index 8250558..f962e48 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -2196,6 +2196,11 @@ private:
/// EmitDebugLines - Emit source line information.
///
void EmitDebugLines() {
+ // If there are no lines to emit (such as when we're using .loc directives
+ // to emit .debug_line information) don't emit a .debug_line header.
+ if (SectionSourceLines.empty())
+ return;
+
// Minimum line delta, thus ranging from -10..(255-10).
const int MinLineDelta = -(DW_LNS_fixed_advance_pc + 1);
// Maximum line delta, thus ranging from -10..(255-10).