[llvm] r206042 - Debug info: Store the DIVariable in DebugLocEntry also for constants,
Adrian Prantl
aprantl at apple.com
Fri Apr 11 10:49:47 PDT 2014
Author: adrian
Date: Fri Apr 11 12:49:47 2014
New Revision: 206042
URL: http://llvm.org/viewvc/llvm-project?rev=206042&view=rev
Log:
Debug info: Store the DIVariable in DebugLocEntry also for constants,
so DwarfDebug::emitDebugLocEntry can emit them with the correct signedness.
rdar://problem/15928306
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/test/DebugInfo/X86/dbg-const.ll
llvm/trunk/test/DebugInfo/X86/dbg-value-const-byref.ll
llvm/trunk/test/DebugInfo/X86/fission-ranges.ll
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h?rev=206042&r1=206041&r2=206042&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DebugLocEntry.h Fri Apr 11 12:49:47 2014
@@ -76,20 +76,20 @@ public:
EntryKind = E_Location;
}
DebugLocEntry(const MCSymbol *B, const MCSymbol *E, int64_t i,
- const DwarfCompileUnit *U)
- : Begin(B), End(E), Variable(0), Unit(U) {
+ const MDNode *V, const DwarfCompileUnit *U)
+ : Begin(B), End(E), Variable(V), Unit(U) {
Constants.Int = i;
EntryKind = E_Integer;
}
DebugLocEntry(const MCSymbol *B, const MCSymbol *E, const ConstantFP *FPtr,
- const DwarfCompileUnit *U)
- : Begin(B), End(E), Variable(0), Unit(U) {
+ const MDNode *V, const DwarfCompileUnit *U)
+ : Begin(B), End(E), Variable(V), Unit(U) {
Constants.CFP = FPtr;
EntryKind = E_ConstantFP;
}
DebugLocEntry(const MCSymbol *B, const MCSymbol *E, const ConstantInt *IPtr,
- const DwarfCompileUnit *U)
- : Begin(B), End(E), Variable(0), Unit(U) {
+ const MDNode *V, const DwarfCompileUnit *U)
+ : Begin(B), End(E), Variable(V), Unit(U) {
Constants.CIP = IPtr;
EntryKind = E_ConstantInt;
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=206042&r1=206041&r2=206042&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Apr 11 12:49:47 2014
@@ -1212,11 +1212,13 @@ static DebugLocEntry getDebugLocEntry(As
return DebugLocEntry(FLabel, SLabel, MLoc, Var, Unit);
}
if (MI->getOperand(0).isImm())
- return DebugLocEntry(FLabel, SLabel, MI->getOperand(0).getImm(), Unit);
+ return DebugLocEntry(FLabel, SLabel, MI->getOperand(0).getImm(), Var, Unit);
if (MI->getOperand(0).isFPImm())
- return DebugLocEntry(FLabel, SLabel, MI->getOperand(0).getFPImm(), Unit);
+ return DebugLocEntry(FLabel, SLabel, MI->getOperand(0).getFPImm(),
+ Var, Unit);
if (MI->getOperand(0).isCImm())
- return DebugLocEntry(FLabel, SLabel, MI->getOperand(0).getCImm(), Unit);
+ return DebugLocEntry(FLabel, SLabel, MI->getOperand(0).getCImm(),
+ Var, Unit);
llvm_unreachable("Unexpected 3 operand DBG_VALUE instruction!");
}
Modified: llvm/trunk/test/DebugInfo/X86/dbg-const.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dbg-const.ll?rev=206042&r1=206041&r2=206042&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/dbg-const.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/dbg-const.ll Fri Apr 11 12:49:47 2014
@@ -13,7 +13,7 @@
target triple = "x86_64-apple-darwin10.0.0"
-;CHECK: ## DW_OP_constu
+;CHECK: ## DW_OP_consts
;CHECK-NEXT: .byte 42
define i32 @foobar() nounwind readonly noinline ssp {
entry:
Modified: llvm/trunk/test/DebugInfo/X86/dbg-value-const-byref.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/dbg-value-const-byref.ll?rev=206042&r1=206041&r2=206042&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/dbg-value-const-byref.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/dbg-value-const-byref.ll Fri Apr 11 12:49:47 2014
@@ -25,14 +25,14 @@
; CHECK: DW_AT_location [DW_FORM_data4] ([[LOC:.*]])
; CHECK: .debug_loc contents:
; CHECK: [[LOC]]:
-; constu 0x00000003
+; consts 0x00000003
; CHECK: Beginning address offset: 0x0000000000000{{.*}}
; CHECK: Ending address offset: [[C1:.*]]
-; CHECK: Location description: 10 03
-; constu 0x00000007
+; CHECK: Location description: 11 03
+; consts 0x00000007
; CHECK: Beginning address offset: [[C1]]
; CHECK: Ending address offset: [[C2:.*]]
-; CHECK: Location description: 10 07
+; CHECK: Location description: 11 07
; rax, piece 0x00000004
; CHECK: Beginning address offset: [[C2]]
; CHECK: Ending address offset: [[R1:.*]]
Modified: llvm/trunk/test/DebugInfo/X86/fission-ranges.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/fission-ranges.ll?rev=206042&r1=206041&r2=206042&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/X86/fission-ranges.ll (original)
+++ llvm/trunk/test/DebugInfo/X86/fission-ranges.ll Fri Apr 11 12:49:47 2014
@@ -26,7 +26,7 @@
; CHECK: [[A]]: Beginning address index: 2
; CHECK-NEXT: Length: 199
-; CHECK-NEXT: Location description: 10 00
+; CHECK-NEXT: Location description: 11 00
; CHECK-NEXT: {{^$}}
; CHECK-NEXT: Beginning address index: 3
; CHECK-NEXT: Length: 23
More information about the llvm-commits
mailing list