Ignore DBG_VALUE machine instructions while constructing instruction ranges based...
authorDevang Patel <dpatel@apple.com>
Tue, 15 Feb 2011 17:56:09 +0000 (17:56 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 15 Feb 2011 17:56:09 +0000 (17:56 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125577 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp
test/CodeGen/X86/dbg-value-range.ll

index 0ecb3dfd1967e5a20092222dd0476d7274424e82..3c284bfd91ea463e67ea18e93f54d161fdd3667f 100644 (file)
@@ -2708,6 +2708,10 @@ bool DwarfDebug::extractScopeInformation() {
         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
index ff7f8c64214d3c556690472c8450ec0c8c4942fc..2985224d9dbdc6aed3db8ae1598f65ad557f9f8a 100644 (file)
@@ -44,12 +44,12 @@ declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
 ; 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