Skip to content

Commit 4a1d82a

Browse files
Merge pull request swiftlang#36115 from aschwaighofer/enable_use_of_swiftasynccc
Enable the use of swiftasynccc
2 parents 17e9dd1 + 4f208fe commit 4a1d82a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ option(USE_SWIFT_ASYNC_LOWERING
201201
functions if it is supported for the target. The runtime also checks
202202
this setting before using async-specific attributes. This only applies
203203
to the async calling convention and not to the async context attribute."
204-
FALSE)
204+
TRUE)
205205

206206
#
207207
# User-configurable Swift Standard Library specific options.

lib/IRGen/IRGenModule.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,12 @@ IRGenModule::IRGenModule(IRGenerator &irgen,
547547
// TODO: use "tinycc" on platforms that support it
548548
DefaultCC = SWIFT_DEFAULT_LLVM_CC;
549549
SwiftCC = llvm::CallingConv::Swift;
550-
// TODO: Once clang support is merged this should also use
551-
// clangASTContext.getTargetInfo().isSwiftAsyncCCSupported()
552-
SwiftAsyncCC = opts.UseAsyncLowering ? llvm::CallingConv::SwiftTail : SwiftCC;
550+
551+
bool isAsynCCSupported =
552+
clangASTContext.getTargetInfo().isSwiftAsyncCCSupported();
553+
SwiftAsyncCC = (opts.UseAsyncLowering && isAsynCCSupported)
554+
? llvm::CallingConv::SwiftTail
555+
: SwiftCC;
553556

554557
if (opts.DebugInfoLevel > IRGenDebugInfoLevel::None)
555558
DebugInfo = IRGenDebugInfo::createIRGenDebugInfo(IRGen.Opts, *CI, *this,

0 commit comments

Comments
 (0)