Merge pull request #84528 from rjmccall/async-let-runtime-realism

Model async let begin/finish as builtins in SIL
This commit is contained in:
John McCall
2025-11-05 10:24:46 -08:00
committed by GitHub
48 changed files with 464 additions and 636 deletions

View File

@@ -2549,27 +2549,6 @@ FUNCTION(DistributedActorInitializeRemote,
EFFECT(RuntimeEffect::Concurrency),
UNKNOWN_MEMEFFECTS)
/// void swift_asyncLet_start(
/// AsyncLet *alet,
/// TaskOptionRecord *options,
/// const Metadata *futureResultType,
/// void *closureEntryPoint,
/// HeapObject *closureContext
/// );
FUNCTION(AsyncLetStart,
_Concurrency, swift_asyncLet_start, SwiftCC,
ConcurrencyAvailability,
RETURNS(VoidTy),
ARGS(SwiftAsyncLetPtrTy, // AsyncLet*
SwiftTaskOptionRecordPtrTy, // options
TypeMetadataPtrTy, // futureResultType
Int8PtrTy, // closureEntry
OpaquePtrTy // closureContext
),
ATTRS(NoUnwind),
EFFECT(RuntimeEffect::Concurrency),
MEMEFFECTS(ArgMemOnly))
/// void swift_asyncLet_begin(
/// AsyncLet *alet,
/// TaskOptionRecord *options,
@@ -2593,15 +2572,27 @@ FUNCTION(AsyncLetBegin,
EFFECT(RuntimeEffect::Concurrency),
MEMEFFECTS(ArgMemOnly))
// void swift_asyncLet_end(AsyncLet *alet);
FUNCTION(EndAsyncLet,
_Concurrency, swift_asyncLet_end, SwiftCC,
/// void swift_asyncLet_finish(
/// AsyncLet *alet,
/// TaskOptionRecord *options,
/// const Metadata *futureResultType,
/// void *closureEntryPoint,
/// HeapObject *closureContext,
/// void *resultBuffer
/// );
FUNCTION(AsyncLetFinish,
_Concurrency, swift_asyncLet_finish, SwiftAsyncCC,
ConcurrencyAvailability,
RETURNS(VoidTy),
ARGS(SwiftAsyncLetPtrTy),
ARGS(SwiftContextPtrTy, // current context
SwiftAsyncLetPtrTy, // AsyncLet*
Int8PtrTy, // resultBuffer
TaskContinuationFunctionPtrTy, // continuation
SwiftContextPtrTy // temp context
),
ATTRS(NoUnwind),
EFFECT(RuntimeEffect::Concurrency),
UNKNOWN_MEMEFFECTS)
MEMEFFECTS(ArgMemOnly))
/// void swift_task_run_inline(
/// OpaqueValue *result,