diff options
| author | Dan Gohman <gohman@apple.com> | 2007-09-24 21:43:52 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2007-09-24 21:43:52 +0000 |
| commit | 3165699e4be79f6b8b5e0937f908346d5389a78c (patch) | |
| tree | 240c441790a0a6d31623e0ea6233083025cd08c7 /llvm/lib/CodeGen/DwarfWriter.cpp | |
| parent | 9b00c07be576e0280cf4b9ff70227b6330b11ec6 (diff) | |
| download | bcm5719-llvm-3165699e4be79f6b8b5e0937f908346d5389a78c.tar.gz bcm5719-llvm-3165699e4be79f6b8b5e0937f908346d5389a78c.zip | |
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.
llvm-svn: 42277
Diffstat (limited to 'llvm/lib/CodeGen/DwarfWriter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/DwarfWriter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/DwarfWriter.cpp b/llvm/lib/CodeGen/DwarfWriter.cpp index 8250558b267..f962e487340 100644 --- a/llvm/lib/CodeGen/DwarfWriter.cpp +++ b/llvm/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). |

