File tree Expand file tree Collapse file tree 4 files changed +25
-6
lines changed Expand file tree Collapse file tree 4 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,12 @@ for the full list.
215
215
216
216
This allows the ``_Nullable `` and ``_Nonnull` family of type attributes to
217
217
apply to this class.
218
+ - The ``swiftasynccc `` attribute is now considered to be a Clang extension
219
+ rather than a language standard feature. Please use
220
+ ``__has_extension(swiftasynccc) `` to check the availability of this attribute
221
+ for the target platform instead of ``__has_feature(swiftasynccc) ``. Also,
222
+ added a new extension query ``__has_extension(swiftcc) `` corresponding to the
223
+ ``__attribute__((swiftcc)) `` attribute.
218
224
219
225
Improvements to Clang's diagnostics
220
226
-----------------------------------
Original file line number Diff line number Diff line change @@ -5162,10 +5162,11 @@ that does not. A single parameter may not have multiple ABI treatment
5162
5162
attributes.
5163
5163
5164
5164
Support for this feature is target-dependent, although it should be
5165
- supported on every target that Swift supports. Query for this support
5166
- with ``__has_attribute(swiftcall)``. This implies support for the
5167
- ``swift_context``, ``swift_error_result``, and ``swift_indirect_result``
5168
- attributes.
5165
+ supported on every target that Swift supports. Query for this attribute
5166
+ with ``__has_attribute(swiftcall)``. Query if the target supports the
5167
+ calling convention with ``__has_extension(swiftcc)``. This implies
5168
+ support for the ``swift_context``, ``swift_error_result``, and
5169
+ ``swift_indirect_result`` attributes.
5169
5170
}];
5170
5171
}
5171
5172
@@ -5212,6 +5213,10 @@ the following:
5212
5213
semantically be performed after a guaranteed tail call, such as the
5213
5214
non-trivial destruction of a local variable or temporary,
5214
5215
then the program is ill-formed.
5216
+
5217
+ Query for this attribute with ``__has_attribute(swiftasynccall)``. Query if
5218
+ the target supports the calling convention with
5219
+ ``__has_extension(swiftasynccc)``.
5215
5220
}];
5216
5221
}
5217
5222
Original file line number Diff line number Diff line change @@ -102,7 +102,10 @@ FEATURE(memory_sanitizer,
102
102
FEATURE(thread_sanitizer, LangOpts.Sanitize.has(SanitizerKind::Thread))
103
103
FEATURE(dataflow_sanitizer, LangOpts.Sanitize.has(SanitizerKind::DataFlow))
104
104
FEATURE(scudo, LangOpts.Sanitize.hasOneOf(SanitizerKind::Scudo))
105
- FEATURE(swiftasynccc,
105
+ EXTENSION(swiftcc,
106
+ PP.getTargetInfo().checkCallingConvention(CC_Swift) ==
107
+ clang::TargetInfo::CCCR_OK)
108
+ EXTENSION(swiftasynccc,
106
109
PP.getTargetInfo().checkCallingConvention(CC_SwiftAsync) ==
107
110
clang::TargetInfo::CCCR_OK)
108
111
FEATURE(pragma_stdc_cx_limited_range, true )
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 ) {}
You can’t perform that action at this time.
0 commit comments