File tree Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,13 @@ if(SWIFT_PROFDATA_FILE AND EXISTS ${SWIFT_PROFDATA_FILE})
196
196
add_definitions ("-fprofile-instr-use=${SWIFT_PROFDATA_FILE} " )
197
197
endif ()
198
198
199
+ option (USE_SWIFT_ASYNC_LOWERING
200
+ "Indicates if Swiftc should use async-specific lowering for async
201
+ functions if it is supported for the target. The runtime also checks
202
+ this setting before using async-specific attributes. This only applies
203
+ to the async calling convention and not to the async context attribute."
204
+ FALSE )
205
+
199
206
#
200
207
# User-configurable Swift Standard Library specific options.
201
208
#
Original file line number Diff line number Diff line change 23
23
#include " swift/Basic/Sanitizers.h"
24
24
#include " swift/Basic/OptionSet.h"
25
25
#include " swift/Basic/OptimizationMode.h"
26
+ #include " swift/Config.h"
26
27
#include " clang/Basic/PointerAuthOptions.h"
27
28
// FIXME: This include is just for llvm::SanitizerCoverageOptions. We should
28
29
// split the header upstream so we don't include so much.
@@ -337,6 +338,10 @@ class IRGenOptions {
337
338
// / Pointer authentication.
338
339
PointerAuthOptions PointerAuth;
339
340
341
+ // / Use async-specific lowering for async functions if it is supported for
342
+ // / the target.
343
+ bool UseAsyncLowering = USE_SWIFT_ASYNC_LOWERING;
344
+
340
345
// / The different modes for dumping IRGen type info.
341
346
enum class TypeInfoDumpFilter {
342
347
All,
Original file line number Diff line number Diff line change 8
8
9
9
#cmakedefine HAVE_PROC_PID_RUSAGE 1
10
10
11
+ #cmakedefine01 USE_SWIFT_ASYNC_LOWERING
12
+
11
13
#endif // SWIFT_CONFIG_H
Original file line number Diff line number Diff line change 7
7
#cmakedefine01 SWIFT_BNI_OS_BUILD
8
8
#cmakedefine01 SWIFT_BNI_XCODE_BUILD
9
9
10
+ #cmakedefine01 USE_SWIFT_ASYNC_LOWERING
11
+
10
12
#endif
Original file line number Diff line number Diff line change @@ -184,7 +184,8 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
184
184
185
185
// SWIFT_CC(swiftasync) is the Swift async calling convention.
186
186
// We assume that it supports mandatory tail call elimination.
187
- #if __has_attribute(swiftasynccall)
187
+ #if __has_feature(swiftasynccc) && USE_SWIFT_ASYNC_LOWERING && \
188
+ __has_attribute (swiftasynccall)
188
189
#define SWIFT_CC_swiftasync __attribute__ ((swiftasynccall))
189
190
#else
190
191
#define SWIFT_CC_swiftasync SWIFT_CC_swift
You can’t perform that action at this time.
0 commit comments