1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 02:33:06 +01:00

[Demangle] Support demangling Swift calling convention in MS demangler.

Previously, Clang was able to mangle the Swift calling
convention but 'MicrosoftDemangle.cpp' was not able to demangle it.

Reviewed By: compnerd, rnk

Differential Revision: https://reviews.llvm.org/D95053
This commit is contained in:
Varun Gandhi 2021-01-20 08:24:28 -08:00
parent 4d950d6390
commit 52a271678f
4 changed files with 9 additions and 0 deletions

View File

@ -67,6 +67,7 @@ enum class CallingConv : uint8_t {
Eabi,
Vectorcall,
Regcall,
Swift, // Clang-only
};
enum class ReferenceKind : uint8_t { None, LValueRef, RValueRef };

View File

@ -1711,6 +1711,8 @@ CallingConv Demangler::demangleCallingConvention(StringView &MangledName) {
return CallingConv::Eabi;
case 'Q':
return CallingConv::Vectorcall;
case 'S':
return CallingConv::Swift;
}
return CallingConv::None;

View File

@ -107,6 +107,9 @@ static void outputCallingConvention(OutputStream &OS, CallingConv CC) {
case CallingConv::Clrcall:
OS << "__clrcall";
break;
case CallingConv::Swift:
OS << "__attribute__((__swiftcall__)) ";
break;
default:
break;
}

View File

@ -338,6 +338,9 @@
?vector_func@@YQXXZ
; CHECK: void __vectorcall vector_func(void)
?swift_func@@YSXXZ
; CHECK: void __attribute__((__swiftcall__)) swift_func(void)
??$fn_tmpl@$1?extern_c_func@@YAXXZ@@YAXXZ
; CHECK: void __cdecl fn_tmpl<&void __cdecl extern_c_func(void)>(void)