mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Concurrency] Implement a builtin createAsyncTask() to create a new task.
`Builtin.createAsyncTask` takes flags, an optional parent task, and an async/throwing function to execute, and passes it along to the `swift_task_create_f` entry point to create a new (potentially child) task, returning the new task and its initial context.
This commit is contained in:
@@ -602,6 +602,10 @@ IRGenModule::IRGenModule(IRGenerator &irgen,
|
||||
/*isVarArg*/ false);
|
||||
TaskContinuationFunctionPtrTy = TaskContinuationFunctionTy->getPointerTo();
|
||||
|
||||
AsyncTaskAndContextTy = createStructType(
|
||||
*this, "swift.async_task_and_context",
|
||||
{ SwiftTaskPtrTy, SwiftContextPtrTy });
|
||||
|
||||
DifferentiabilityWitnessTy = createStructType(
|
||||
*this, "swift.differentiability_witness", {Int8PtrTy, Int8PtrTy});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user