Skip to content

Commit 380f0fb

Browse files
committed
[CodeGen/DWARF] Introduce DWARF tag for SwiftTail and emit it in CodeGen.
swifttailcc is a new calling convention in LLVM introduced in https://reviews.llvm.org/D95443. We add a new DWARF tag to capture this in debuginfo. Differential Revision: https://reviews.llvm.org/D95704 [Note: This patch seems to have been forgotten about, landing it now with considerable delay]
1 parent 23d45e5 commit 380f0fb

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,8 +1440,7 @@ static unsigned getDwarfCC(CallingConv CC) {
14401440
case CC_Swift:
14411441
return llvm::dwarf::DW_CC_LLVM_Swift;
14421442
case CC_SwiftAsync:
1443-
// [FIXME: swiftasynccc] Update to SwiftAsync once LLVM support lands.
1444-
return llvm::dwarf::DW_CC_LLVM_Swift;
1443+
return llvm::dwarf::DW_CC_LLVM_SwiftTail;
14451444
case CC_PreserveMost:
14461445
return llvm::dwarf::DW_CC_LLVM_PreserveMost;
14471446
case CC_PreserveAll:

clang/test/CodeGen/debug-info-cc.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ __attribute__((swiftcall)) int add_swiftcall(int a, int b) {
6464
return a+b;
6565
}
6666

67-
// [FIXME: swiftasynccc] Update debuginfo tag to SwiftAsync once LLVM support lands.
6867
// LINUX: !DISubprogram({{.*}}"add_swiftasynccall", {{.*}}type: ![[FTY:[0-9]+]]
69-
// LINUX: ![[FTY]] = !DISubroutineType({{.*}}cc: DW_CC_LLVM_Swift,
70-
__attribute__((swiftasynccall)) int add_swiftasynccall(int a, int b, int c) {
71-
return a+b+c;
68+
// LINUX: ![[FTY]] = !DISubroutineType({{.*}}cc: DW_CC_LLVM_SwiftTail,
69+
__attribute__((swiftasynccall)) int add_swiftasynccall(int a, int b) {
70+
return a+b;
7271
}
7372

7473
// LINUX: !DISubprogram({{.*}}"add_inteloclbicc", {{.*}}type: ![[FTY:[0-9]+]]

llvm/include/llvm/BinaryFormat/Dwarf.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,7 @@ HANDLE_DW_CC(0xcb, LLVM_X86RegCall)
10411041
HANDLE_DW_CC(0xcc, LLVM_M68kRTD)
10421042
HANDLE_DW_CC(0xcd, LLVM_PreserveNone)
10431043
HANDLE_DW_CC(0xce, LLVM_RISCVVectorCall)
1044+
HANDLE_DW_CC(0xcf, LLVM_SwiftTail)
10441045
// From GCC source code (include/dwarf2.h): This DW_CC_ value is not currently
10451046
// generated by any toolchain. It is used internally to GDB to indicate OpenCL
10461047
// C functions that have been compiled with the IBM XL C for OpenCL compiler and

0 commit comments

Comments
 (0)