File tree 4 files changed +33
-6
lines changed 4 files changed +33
-6
lines changed Original file line number Diff line number Diff line change @@ -371,6 +371,13 @@ Attribute Changes in Clang
371
371
supports but that are never the result of default argument promotion, such as
372
372
``float ``. (`#59824: <https://github.com/llvm/llvm-project/issues/59824 >`_)
373
373
374
+ - The ``swiftasynccc `` attribute is now considered to be a Clang extension
375
+ rather than a language standard feature. Please use
376
+ ``__has_extension(swiftasynccc) `` to check the availability of this attribute
377
+ for the target platform instead of ``__has_feature(swiftasynccc) ``. Also,
378
+ added a new extension query ``__has_extension(swiftcc) `` corresponding to the
379
+ ``__attribute__((swiftcc)) `` attribute.
380
+
374
381
Improvements to Clang's diagnostics
375
382
-----------------------------------
376
383
- We now generate a diagnostic for signed integer overflow due to unary minus
Original file line number Diff line number Diff line change @@ -5105,10 +5105,11 @@ that does not. A single parameter may not have multiple ABI treatment
5105
5105
attributes.
5106
5106
5107
5107
Support for this feature is target-dependent, although it should be
5108
- supported on every target that Swift supports. Query for this support
5109
- with ``__has_attribute(swiftcall)``. This implies support for the
5110
- ``swift_context``, ``swift_error_result``, and ``swift_indirect_result``
5111
- attributes.
5108
+ supported on every target that Swift supports. Query for this attribute
5109
+ with ``__has_attribute(swiftcall)``. Query if the target supports the
5110
+ calling convention with ``__has_extension(swiftcc)``. This implies
5111
+ support for the ``swift_context``, ``swift_error_result``, and
5112
+ ``swift_indirect_result`` attributes.
5112
5113
}];
5113
5114
}
5114
5115
@@ -5155,6 +5156,10 @@ the following:
5155
5156
semantically be performed after a guaranteed tail call, such as the
5156
5157
non-trivial destruction of a local variable or temporary,
5157
5158
then the program is ill-formed.
5159
+
5160
+ Query for this attribute with ``__has_attribute(swiftasynccall)``. Query if
5161
+ the target supports the calling convention with
5162
+ ``__has_extension(swiftasynccc)``.
5158
5163
}];
5159
5164
}
5160
5165
Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ FEATURE(ptrauth_calls, LangOpts.PointerAuthCalls)
108
108
FEATURE(ptrauth_returns, LangOpts.PointerAuthReturns)
109
109
FEATURE(ptrauth_indirect_gotos, LangOpts.PointerAuthIndirectGotos)
110
110
FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo))
111
- FEATURE(swiftasynccc,
111
+ EXTENSION(swiftcc,
112
+ PP.getTargetInfo().checkCallingConvention(CC_Swift) ==
113
+ clang::TargetInfo::CCCR_OK)
114
+ EXTENSION(swiftasynccc,
112
115
PP.getTargetInfo().checkCallingConvention(CC_SwiftAsync) ==
113
116
clang::TargetInfo::CCCR_OK)
114
117
// Objective-C features
Original file line number Diff line number Diff line change 1
1
// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -fsyntax-only %s -verify
2
2
// RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -fsyntax-only %s -verify
3
3
// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fsyntax-only %s -verify
4
+ // RISC-V does not support swiftcall
5
+ // RUN: %clang_cc1 -triple riscv32-unknown-elf -fsyntax-only %s -verify
4
6
7
+ #if __has_extension (swiftcc )
5
8
// expected-no-diagnostics
6
-
9
+ #else
10
+ // expected-warning@+2 {{'__swiftcall__' calling convention is not supported for this target}}
11
+ #endif
7
12
void __attribute__((__swiftcall__ )) f (void ) {}
13
+
14
+ #if __has_extension (swiftasynccc )
15
+ // expected-no-diagnostics
16
+ #else
17
+ // expected-warning@+2 {{'__swiftasynccall__' calling convention is not supported for this target}}
18
+ #endif
19
+ void __attribute__((__swiftasynccall__ )) g (void ) {}
You can’t perform that action at this time.
0 commit comments