[llvm-commits] [llvm] r42277 - /llvm/trunk/lib/CodeGen/DwarfWriter.cpp
Dan Gohman
djg at cray.com
Mon Sep 24 14:43:52 PDT 2007
Author: djg
Date: Mon Sep 24 16:43:52 2007
New Revision: 42277
URL: http://llvm.org/viewvc/llvm-project?rev=42277&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/DwarfWriter.cpp
Modified: llvm/trunk/lib/CodeGen/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/DwarfWriter.cpp?rev=42277&r1=42276&r2=42277&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/DwarfWriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/DwarfWriter.cpp Mon Sep 24 16:43:52 2007
@@ -2196,6 +2196,11 @@
/// 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).
More information about the llvm-commits
mailing list