summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
-rw-r--r--llvm/test/CodeGen/X86/dbg-value-range.ll4
2 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 0ecb3dfd196..3c284bfd91e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -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
diff --git a/llvm/test/CodeGen/X86/dbg-value-range.ll b/llvm/test/CodeGen/X86/dbg-value-range.ll
index ff7f8c64214..2985224d9db 100644
--- a/llvm/test/CodeGen/X86/dbg-value-range.ll
+++ b/llvm/test/CodeGen/X86/dbg-value-range.ll
@@ -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
OpenPOWER on IntegriCloud