Skip to content

Commit 4f208fe

Browse files
committed
Take clang's isSwiftAsyncCCSupported into account
1 parent 0750dde commit 4f208fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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)