[llvm-commits] [llvm] r103226 - in /llvm/trunk: lib/CodeGen/AsmPrinter/DwarfDebug.cpp test/CodeGen/X86/unknown-location.ll

Dan Gohman gohman at apple.com
Thu May 6 18:08:53 PDT 2010


Author: djg
Date: Thu May  6 20:08:53 2010
New Revision: 103226

URL: http://llvm.org/viewvc/llvm-project?rev=103226&view=rev
Log:
Disable the new unknown-location code for now. It causes a major
increase in the debug line info section, and it's causing
regressions in a gdb testsuite.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/test/CodeGen/X86/unknown-location.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=103226&r1=103225&r2=103226&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Thu May  6 20:08:53 2010
@@ -47,6 +47,10 @@
 static cl::opt<bool> DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden,
      cl::desc("Disable debug info printing"));
 
+static cl::opt<bool> UnknownLocations("use-unknown-locations", cl::Hidden,
+     cl::desc("Make an absense of debug location information explicit."),
+     cl::init(false));
+
 namespace {
   const char *DWARFGroupName = "DWARF Emission";
   const char *DbgTimerName = "DWARF Debug Writer";
@@ -2151,21 +2155,23 @@
   // Check location.
   DebugLoc DL = MI->getDebugLoc();
   if (DL.isUnknown()) {
-    // This instruction has no debug location. If the preceding instruction
-    // did, emit debug location information to indicate that the debug
-    // location is now unknown.
-    MCSymbol *Label = NULL;
-    if (DL == PrevInstLoc)
-      Label = PrevLabel;
-    else {
-      Label = recordSourceLine(DL.getLine(), DL.getCol(), 0);
-      PrevInstLoc = DL;
-      PrevLabel = Label;
-    }
+    if (UnknownLocations) {
+      // This instruction has no debug location. If the preceding instruction
+      // did, emit debug location information to indicate that the debug
+      // location is now unknown.
+      MCSymbol *Label = NULL;
+      if (DL == PrevInstLoc)
+        Label = PrevLabel;
+      else {
+        Label = recordSourceLine(DL.getLine(), DL.getCol(), 0);
+        PrevInstLoc = DL;
+        PrevLabel = Label;
+      }
 
-    // If this instruction begins a scope then note down corresponding label.
-    if (InsnsBeginScopeSet.count(MI) != 0)
-      LabelsBeforeInsn[MI] = Label;
+      // If this instruction begins a scope then note down corresponding label.
+      if (InsnsBeginScopeSet.count(MI) != 0)
+        LabelsBeforeInsn[MI] = Label;
+    }
 
     return;
   }

Modified: llvm/trunk/test/CodeGen/X86/unknown-location.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/unknown-location.ll?rev=103226&r1=103225&r2=103226&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/unknown-location.ll (original)
+++ llvm/trunk/test/CodeGen/X86/unknown-location.ll Thu May  6 20:08:53 2010
@@ -1,4 +1,4 @@
-; RUN: llc < %s -asm-verbose=false -march=x86-64 | FileCheck %s
+; RUN: llc < %s -asm-verbose=false -march=x86-64 -use-unknown-locations | FileCheck %s
 
 ; The divide instruction does not have a debug location. CodeGen should
 ; represent this in the debug information. This is checked by a check





More information about the llvm-commits mailing list