Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Parse the Swift calling convention in the managed type system
  • Loading branch information
jkoritzinsky committed Jan 19, 2024
commit e056d69de7cb45773cf2afc1f416e23de32ec171
3 changes: 3 additions & 0 deletions src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,9 @@ private static CorInfoCallConvExtension ToCorInfoCallConvExtension(UnmanagedCall
case UnmanagedCallingConventions.Fastcall:
result = CorInfoCallConvExtension.Fastcall;
break;
case UnmanagedCallingConventions.Swift:
result = CorInfoCallConvExtension.Swift;
break;
default:
ThrowHelper.ThrowInvalidProgramException();
result = CorInfoCallConvExtension.Managed; // unreachable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public enum UnmanagedCallingConventions
// Unmanaged = 0x00000009, - this one is always translated to cdecl/stdcall

// The ones higher than 0xF are defined by the type system
// There are no such calling conventions yet.
Swift = 0x00000010
}

public static class CallingConventionExtensions
Expand Down Expand Up @@ -181,6 +181,7 @@ private static UnmanagedCallingConventions AccumulateCallingConventions(Unmanage
"CallConvThiscall" => UnmanagedCallingConventions.Thiscall,
"CallConvSuppressGCTransition" => UnmanagedCallingConventions.IsSuppressGcTransition,
"CallConvMemberFunction" => UnmanagedCallingConventions.IsMemberFunction,
"CallConvSwift" => UnmanagedCallingConventions.Swift,
_ => null
};

Expand Down