Skip to content

Commit a085fdb

Browse files
committed
[IRGen] Defined TaskContinuationFunction.
Added the llvm::StructType and a pointer to it.
1 parent f08df03 commit a085fdb

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,14 @@ IRGenModule::IRGenModule(IRGenerator &irgen,
594594
SwiftTaskPtrTy = SwiftTaskTy->getPointerTo(DefaultAS);
595595
SwiftExecutorPtrTy = SwiftExecutorTy->getPointerTo(DefaultAS);
596596

597+
// using TaskContinuationFunction =
598+
// SWIFT_CC(swift)
599+
// void (AsyncTask *, ExecutorRef, AsyncContext *);
600+
TaskContinuationFunctionTy = llvm::FunctionType::get(
601+
VoidTy, {SwiftTaskPtrTy, SwiftExecutorPtrTy, SwiftContextPtrTy},
602+
/*isVarArg*/ false);
603+
TaskContinuationFunctionPtrTy = TaskContinuationFunctionTy->getPointerTo();
604+
597605
DifferentiabilityWitnessTy = createStructType(
598606
*this, "swift.differentiability_witness", {Int8PtrTy, Int8PtrTy});
599607
}

lib/IRGen/IRGenModule.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ class IRGenModule {
729729
llvm::PointerType *SwiftContextPtrTy;
730730
llvm::PointerType *SwiftTaskPtrTy;
731731
llvm::PointerType *SwiftExecutorPtrTy;
732+
llvm::FunctionType *TaskContinuationFunctionTy;
733+
llvm::PointerType *TaskContinuationFunctionPtrTy;
732734

733735
llvm::StructType *DifferentiabilityWitnessTy; // { i8*, i8* }
734736

0 commit comments

Comments
 (0)