[llvm] r221245 - CodeGen: Enable DWARF emission for MS ABI targets
David Majnemer
david.majnemer at gmail.com
Tue Nov 4 00:03:32 PST 2014
Author: majnemer
Date: Tue Nov 4 02:03:31 2014
New Revision: 221245
URL: http://llvm.org/viewvc/llvm-project?rev=221245&view=rev
Log:
CodeGen: Enable DWARF emission for MS ABI targets
This is experimental, just barely enough to get things to not
immediately combust.
A note for those who are curious:
Only lld can successfully link the object files, other linkers truncate
the section names making the debug sections illegible to debuggers.
Even with this in mind, we believe we are having trouble with SECREL
relocations.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/trunk/test/DebugInfo/COFF/asm.ll
llvm/trunk/test/DebugInfo/COFF/multifile.ll
llvm/trunk/test/DebugInfo/COFF/multifunction.ll
llvm/trunk/test/DebugInfo/COFF/simple.ll
llvm/trunk/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=221245&r1=221244&r2=221245&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Nov 4 02:03:31 2014
@@ -222,14 +222,12 @@ bool AsmPrinter::doInitialization(Module
}
if (MAI->doesSupportDebugInformation()) {
- if (Triple(TM.getTargetTriple()).isKnownWindowsMSVCEnvironment()) {
+ if (Triple(TM.getTargetTriple()).isKnownWindowsMSVCEnvironment())
Handlers.push_back(HandlerInfo(new WinCodeViewLineTables(this),
DbgTimerName,
CodeViewLineTablesGroupName));
- } else {
- DD = new DwarfDebug(this, &M);
- Handlers.push_back(HandlerInfo(DD, DbgTimerName, DWARFGroupName));
- }
+ DD = new DwarfDebug(this, &M);
+ Handlers.push_back(HandlerInfo(DD, DbgTimerName, DWARFGroupName));
}
EHStreamer *ES = nullptr;
Modified: llvm/trunk/test/DebugInfo/COFF/asm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/asm.ll?rev=221245&r1=221244&r2=221245&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/asm.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/asm.ll Tue Nov 4 02:03:31 2014
@@ -13,13 +13,14 @@
; 6 }
; X86-LABEL: _f:
-; X86-NEXT: # BB
+; X86: # BB
; X86-NEXT: [[ASM_LINE:^L.*]]:{{$}}
; X86: [[CALL_LINE:^L.*]]:{{$}}
-; X86-NEXT: calll _g
+; X86: calll _g
; X86-NEXT: [[RETURN_STMT:.*]]:
-; X86-NEXT: ret
-; X86-NEXT: [[END_OF_F:.*]]:
+; X86: ret
+; X86-NEXT: L{{.*}}:
+; X86-NEXT: [[END_OF_F:^L.*]]:
;
; X86-LABEL: .section .debug$S,"rd"
; X86-NEXT: .long 4
@@ -115,14 +116,15 @@
; X64-LABEL: f:
; X64-NEXT: [[START:.*]]:{{$}}
-; X64-NEXT: # BB
-; X64-NEXT: subq $40, %rsp
+; X64: # BB
+; X64: subq $40, %rsp
; X64-NEXT: [[ASM_LINE:.*]]:{{$}}
; X64: [[CALL_LINE:.*]]:{{$}}
-; X64-NEXT: callq g
+; X64: callq g
; X64-NEXT: [[EPILOG_AND_RET:.*]]:
-; X64-NEXT: addq $40, %rsp
+; X64: addq $40, %rsp
; X64-NEXT: ret
+; X64-NEXT: .L{{.*}}:
; X64-NEXT: [[END_OF_F:.*]]:
;
; X64-LABEL: .section .debug$S,"rd"
@@ -239,7 +241,7 @@ attributes #2 = { nounwind }
!0 = metadata !{metadata !"0x11\0012\00clang version 3.5 \000\00\000\00\000", metadata !1, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2} ; [ DW_TAG_compile_unit ] [D:\/<unknown>] [DW_LANG_C99]
!1 = metadata !{metadata !"<unknown>", metadata !"D:\5C"}
-!2 = metadata !{i32 0}
+!2 = metadata !{}
!3 = metadata !{metadata !4}
!4 = metadata !{metadata !"0x2e\00f\00f\00\003\000\001\000\006\00256\000\003", metadata !5, metadata !6, metadata !7, null, void ()* @f, null, null, metadata !2} ; [ DW_TAG_subprogram ] [line 3] [def] [f]
!5 = metadata !{metadata !"asm.c", metadata !"D:\5C"}
Modified: llvm/trunk/test/DebugInfo/COFF/multifile.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/multifile.ll?rev=221245&r1=221244&r2=221245&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/multifile.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/multifile.ll Tue Nov 4 02:03:31 2014
@@ -17,15 +17,16 @@
; 10 }
; X86-LABEL: _f:
-; X86-NEXT: # BB
+; X86: # BB
; X86-NEXT: [[CALL_LINE_1:.*]]:{{$}}
-; X86-NEXT: calll _g
+; X86: calll _g
; X86-NEXT: [[CALL_LINE_2:.*]]:{{$}}
-; X86-NEXT: calll _g
+; X86: calll _g
; X86-NEXT: [[CALL_LINE_3:.*]]:{{$}}
-; X86-NEXT: calll _g
+; X86: calll _g
; X86-NEXT: [[RETURN_STMT:.*]]:
-; X86-NEXT: ret
+; X86: ret
+; X86-NEXT: L{{.*}}:
; X86-NEXT: [[END_OF_F:.*]]:
;
; X86-LABEL: .section .debug$S,"rd"
@@ -144,17 +145,18 @@
; X64-LABEL: f:
; X64-NEXT: [[START:.*]]:{{$}}
-; X64-NEXT: # BB
-; X64-NEXT: subq $40, %rsp
+; X64: # BB
+; X64: subq $40, %rsp
; X64-NEXT: [[CALL_LINE_1:.*]]:{{$}}
-; X64-NEXT: callq g
+; X64: callq g
; X64-NEXT: [[CALL_LINE_2:.*]]:{{$}}
-; X64-NEXT: callq g
+; X64: callq g
; X64-NEXT: [[CALL_LINE_3:.*]]:{{$}}
-; X64-NEXT: callq g
+; X64: callq g
; X64-NEXT: [[EPILOG_AND_RET:.*]]:
-; X64-NEXT: addq $40, %rsp
+; X64: addq $40, %rsp
; X64-NEXT: ret
+; X64-NEXT: .L{{.*}}:
; X64-NEXT: [[END_OF_F:.*]]:
;
; X64-LABEL: .section .debug$S,"rd"
@@ -307,7 +309,7 @@ attributes #1 = { "less-precise-fpmad"="
!0 = metadata !{metadata !"0x11\0012\00clang version 3.5 \000\00\000\00\000", metadata !1, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2} ; [ DW_TAG_compile_unit ] [D:\/<unknown>] [DW_LANG_C99]
!1 = metadata !{metadata !"<unknown>", metadata !"D:\5C"}
-!2 = metadata !{i32 0}
+!2 = metadata !{}
!3 = metadata !{metadata !4}
!4 = metadata !{metadata !"0x2e\00f\00f\00\003\000\001\000\006\00256\000\003", metadata !5, metadata !6, metadata !7, null, void ()* @f, null, null, metadata !2} ; [ DW_TAG_subprogram ] [line 3] [def] [f]
!5 = metadata !{metadata !"input.c", metadata !"D:\5C"}
Modified: llvm/trunk/test/DebugInfo/COFF/multifunction.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/multifunction.ll?rev=221245&r1=221244&r2=221245&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/multifunction.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/multifunction.ll Tue Nov 4 02:03:31 2014
@@ -23,31 +23,34 @@
; X86-LABEL: _x:
-; X86-NEXT: # BB
+; X86: # BB
; X86-NEXT: [[X_CALL:.*]]:{{$}}
-; X86-NEXT: calll _z
+; X86: calll _z
; X86-NEXT: [[X_RETURN:.*]]:
-; X86-NEXT: ret
+; X86: ret
+; X86-NEXT: L{{.*}}:
; X86-NEXT: [[END_OF_X:.*]]:
;
; X86-LABEL: _y:
-; X86-NEXT: # BB
+; X86: # BB
; X86-NEXT: [[Y_CALL:.*]]:{{$}}
-; X86-NEXT: calll _z
+; X86: calll _z
; X86-NEXT: [[Y_RETURN:.*]]:
-; X86-NEXT: ret
+; X86: ret
+; X86-NEXT: L{{.*}}:
; X86-NEXT: [[END_OF_Y:.*]]:
;
; X86-LABEL: _f:
-; X86-NEXT: # BB
+; X86: # BB
; X86-NEXT: [[F_CALLS_X:.*]]:{{$}}
-; X86-NEXT: calll _x
+; X86: calll _x
; X86-NEXT: [[F_CALLS_Y:.*]]:
-; X86-NEXT: calll _y
+; X86: calll _y
; X86-NEXT: [[F_CALLS_Z:.*]]:
-; X86-NEXT: calll _z
+; X86: calll _z
; X86-NEXT: [[F_RETURN:.*]]:
-; X86-NEXT: ret
+; X86: ret
+; X86-NEXT: L{{.*}}:
; X86-NEXT: [[END_OF_F:.*]]:
;
; X86-LABEL: .section .debug$S,"rd"
@@ -276,39 +279,42 @@
; X64-LABEL: x:
; X64-NEXT: [[X_START:.*]]:{{$}}
-; X64-NEXT: # BB
-; X64-NEXT: subq $40, %rsp
+; X64: # BB
+; X64: subq $40, %rsp
; X64-NEXT: [[X_CALL_LINE:.*]]:{{$}}
; X64-NEXT: callq z
; X64-NEXT: [[X_EPILOG_AND_RET:.*]]:
-; X64-NEXT: addq $40, %rsp
+; X64: addq $40, %rsp
; X64-NEXT: ret
+; X64-NEXT: .L{{.*}}:
; X64-NEXT: [[END_OF_X:.*]]:
;
; X64-LABEL: y:
; X64-NEXT: [[Y_START:.*]]:{{$}}
-; X64-NEXT: # BB
-; X64-NEXT: subq $40, %rsp
+; X64: # BB
+; X64: subq $40, %rsp
; X64-NEXT: [[Y_CALL_LINE:.*]]:{{$}}
; X64-NEXT: callq z
; X64-NEXT: [[Y_EPILOG_AND_RET:.*]]:
-; X64-NEXT: addq $40, %rsp
+; X64: addq $40, %rsp
; X64-NEXT: ret
+; X64-NEXT: .L{{.*}}:
; X64-NEXT: [[END_OF_Y:.*]]:
;
; X64-LABEL: f:
; X64-NEXT: [[F_START:.*]]:{{$}}
-; X64-NEXT: # BB
-; X64-NEXT: subq $40, %rsp
+; X64: # BB
+; X64: subq $40, %rsp
; X64-NEXT: [[F_CALLS_X:.*]]:{{$}}
; X64-NEXT: callq x
; X64-NEXT: [[F_CALLS_Y:.*]]:
-; X64-NEXT: callq y
+; X64: callq y
; X64-NEXT: [[F_CALLS_Z:.*]]:
-; X64-NEXT: callq z
+; X64: callq z
; X64-NEXT: [[F_EPILOG_AND_RET:.*]]:
-; X64-NEXT: addq $40, %rsp
+; X64: addq $40, %rsp
; X64-NEXT: ret
+; X64-NEXT: .L{{.*}}:
; X64-NEXT: [[END_OF_F:.*]]:
;
; X64-LABEL: .section .debug$S,"rd"
@@ -578,7 +584,7 @@ attributes #1 = { "less-precise-fpmad"="
!0 = metadata !{metadata !"0x11\0012\00clang version 3.5 \000\00\000\00\000", metadata !1, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2} ; [ DW_TAG_compile_unit ] [D:\/<unknown>] [DW_LANG_C99]
!1 = metadata !{metadata !"<unknown>", metadata !"D:\5C"}
-!2 = metadata !{i32 0}
+!2 = metadata !{}
!3 = metadata !{metadata !4, metadata !9, metadata !10}
!4 = metadata !{metadata !"0x2e\00x\00x\00\003\000\001\000\006\00256\000\003", metadata !5, metadata !6, metadata !7, null, void ()* @x, null, null, metadata !2} ; [ DW_TAG_subprogram ] [line 3] [def] [x]
!5 = metadata !{metadata !"source.c", metadata !"D:\5C"}
Modified: llvm/trunk/test/DebugInfo/COFF/simple.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/simple.ll?rev=221245&r1=221244&r2=221245&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/simple.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/simple.ll Tue Nov 4 02:03:31 2014
@@ -12,11 +12,12 @@
; 5 }
; X86-LABEL: _f:
-; X86-NEXT: # BB
+; X86: # BB
; X86-NEXT: [[CALL_LINE:^L.*]]:{{$}}
-; X86-NEXT: calll _g
+; X86: calll _g
; X86-NEXT: [[RETURN_STMT:.*]]:
-; X86-NEXT: ret
+; X86: ret
+; X86-NEXT: L{{.*}}:
; X86-NEXT: [[END_OF_F:.*]]:
;
; X86-LABEL: .section .debug$S,"rd"
@@ -107,13 +108,14 @@
; X64-LABEL: f:
; X64-NEXT: [[START:.*]]:{{$}}
-; X64-NEXT: # BB
-; X64-NEXT: subq $40, %rsp
+; X64: # BB
+; X64: subq $40, %rsp
; X64-NEXT: [[CALL_LINE:.*]]:{{$}}
; X64-NEXT: callq g
; X64-NEXT: [[EPILOG_AND_RET:.*]]:
-; X64-NEXT: addq $40, %rsp
+; X64: addq $40, %rsp
; X64-NEXT: ret
+; X64-NEXT: .L{{.*}}:
; X64-NEXT: [[END_OF_F:.*]]:
;
; X64-LABEL: .section .debug$S,"rd"
@@ -223,7 +225,7 @@ attributes #1 = { "less-precise-fpmad"="
!0 = metadata !{metadata !"0x11\0012\00clang version 3.5 \000\00\000\00\000", metadata !1, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2} ; [ DW_TAG_compile_unit ] [D:\/<unknown>] [DW_LANG_C99]
!1 = metadata !{metadata !"<unknown>", metadata !"D:\5C"}
-!2 = metadata !{i32 0}
+!2 = metadata !{}
!3 = metadata !{metadata !4}
!4 = metadata !{metadata !"0x2e\00f\00f\00\003\000\001\000\006\00256\000\003", metadata !5, metadata !6, metadata !7, null, void ()* @f, null, null, metadata !2} ; [ DW_TAG_subprogram ] [line 3] [def] [f]
!5 = metadata !{metadata !"test.c", metadata !"D:\5C"}
Modified: llvm/trunk/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll?rev=221245&r1=221244&r2=221245&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/tail-call-without-lexical-scopes.ll Tue Nov 4 02:03:31 2014
@@ -18,7 +18,7 @@
; X86-LABEL: {{^}}"?bar@@YAXHZZ":
; X86-NEXT: # BB
; X86-NEXT: [[JMP_LINE:^L.*]]:{{$}}
-; X86-NEXT: jmp "?foo@@YAXXZ"
+; X86: jmp "?foo@@YAXXZ"
; X86-NEXT: [[END_OF_BAR:^L.*]]:{{$}}
; X86-NOT: ret
More information about the llvm-commits
mailing list