Skip to content

Commit 6692258

Browse files
[embedded] Use __has_feature(swiftcc) to detect Swift calling convention
This change replaces the use of `__has_feature(swiftasynccc)` with `__has_feature(swiftcc)` to detect the SwiftCC availability. The former condition works fine for most platforms that support both SwiftCC and SwiftAsyncCC or neither, but it fails for WebAssembly, which supports SwiftCC but not SwiftAsyncCC. We add `swiftcc` feature to Clang, and use it here.
1 parent 3d4457b commit 6692258

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

stdlib/public/SwiftShims/swift/shims/EmbeddedShims.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
extern "C" {
2929
#endif
3030

31-
// FIXME: Replace with __has_feature(swiftcc) once that's added to Clang.
32-
#if __has_feature(swiftasynccc)
31+
#if __has_feature(swiftcc)
3332
#define SWIFT_CC_swift __attribute__((swiftcall))
3433
#define SWIFT_CONTEXT __attribute__((swift_context))
3534
#define SWIFT_ERROR_RESULT __attribute__((swift_error_result))

0 commit comments

Comments
 (0)