[llvm-commits] [llvm] r125577 - in /llvm/trunk: lib/CodeGen/AsmPrinter/DwarfDebug.cpp test/CodeGen/X86/dbg-value-range.ll

Devang Patel dpatel at apple.com
Tue Feb 15 09:56:09 PST 2011


Author: dpatel
Date: Tue Feb 15 11:56:09 2011
New Revision: 125577

URL: http://llvm.org/viewvc/llvm-project?rev=125577&view=rev
Log:
Ignore DBG_VALUE machine instructions while constructing instruction ranges based on location info. 
Machine instruction range consisting of only DBG_VALUE MIs only contributes consecutive labels in assembly output, which is harmless, and empty scope entry in DebugInfo, which confuses debugger tools.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    llvm/trunk/test/CodeGen/X86/dbg-value-range.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=125577&r1=125576&r2=125577&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Feb 15 11:56:09 2011
@@ -2708,6 +2708,10 @@
         continue;
       }
 
+      // Ignore DBG_VALUE. It does not contribute any instruction in output.
+      if (MInsn->isDebugValue())
+        continue;
+
       if (RangeBeginMI) {
         // If we have alread seen a beginning of a instruction range and
         // current instruction scope does not match scope of first instruction

Modified: llvm/trunk/test/CodeGen/X86/dbg-value-range.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/dbg-value-range.ll?rev=125577&r1=125576&r2=125577&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/dbg-value-range.ll (original)
+++ llvm/trunk/test/CodeGen/X86/dbg-value-range.ll Tue Feb 15 11:56:09 2011
@@ -44,12 +44,12 @@
 ; check that variable bar:b value range is appropriately trucated in debug info. Here Ltmp5 is end of
 ; location range.
 
-;CHECK:Ltmp7
+;CHECK:Ltmp6
 ;CHECK-NEXT: DEBUG_VALUE: bar:b <- undef
 
 ;CHECK:Ldebug_loc0:
 ;CHECK-NEXT:	.quad	Ltmp
-;CHECK-NEXT:	.quad	Ltmp7
+;CHECK-NEXT:	.quad	Ltmp6
 ;CHECK-NEXT:	.short	1
 ;CHECK-NEXT:	.byte	85
 ;CHECK-NEXT:	.quad	0





More information about the llvm-commits mailing list