File tree Expand file tree Collapse file tree 4 files changed +33
-6
lines changed Expand file tree Collapse file tree 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
371371 supports but that are never the result of default argument promotion, such as
372372 ``float ``. (`#59824: <https://github.com/llvm/llvm-project/issues/59824 >`_)
373373
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+
374381Improvements to Clang's diagnostics
375382-----------------------------------
376383- 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
51055105attributes.
51065106
51075107Support 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.
51125113 }];
51135114}
51145115
@@ -5155,6 +5156,10 @@ the following:
51555156 semantically be performed after a guaranteed tail call, such as the
51565157 non-trivial destruction of a local variable or temporary,
51575158 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)``.
51585163 }];
51595164}
51605165
Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ FEATURE(ptrauth_calls, LangOpts.PointerAuthCalls)
108108FEATURE(ptrauth_returns, LangOpts.PointerAuthReturns)
109109FEATURE(ptrauth_indirect_gotos, LangOpts.PointerAuthIndirectGotos)
110110FEATURE(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,
112115 PP.getTargetInfo().checkCallingConvention(CC_SwiftAsync) ==
113116 clang::TargetInfo::CCCR_OK)
114117// Objective-C features
Original file line number Diff line number Diff line change 11// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -fsyntax-only %s -verify
22// RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -fsyntax-only %s -verify
33// 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
46
7+ #if __has_extension (swiftcc )
58// expected-no-diagnostics
6-
9+ #else
10+ // expected-warning@+2 {{'__swiftcall__' calling convention is not supported for this target}}
11+ #endif
712void __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