Skip to content

Commit 78f0105

Browse files
committed
[AsyncLet] remove runChild; it is now asyncLetStart
1 parent dea25d5 commit 78f0105

File tree

6 files changed

+6
-66
lines changed

6 files changed

+6
-66
lines changed

include/swift/Runtime/RuntimeFunctions.def

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,12 @@ FUNCTION(DefaultActorDeallocateResilient,
16781678
ARGS(RefCountedPtrTy),
16791679
ATTRS(NoUnwind))
16801680

1681-
// THE RUNTIME FUNCTION
1681+
/// void swift_asyncLet_start(
1682+
/// AsyncLet *alet,
1683+
/// const Metadata *futureResultType,
1684+
/// void *closureEntryPoint,
1685+
/// HeapObject *closureContext
1686+
/// );
16821687
FUNCTION(AsyncLetStart,
16831688
swift_asyncLet_start, SwiftCC,
16841689
ConcurrencyAvailability,

lib/SILGen/SILGen.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,13 +354,6 @@ static FuncDecl *lookupConcurrencyIntrinsic(ASTContext &C,
354354
return func;
355355
}
356356

357-
FuncDecl *
358-
SILGenModule::getRunChildTask() {
359-
return lookupConcurrencyIntrinsic(getASTContext(),
360-
RunChildTask,
361-
"_runChildTask");
362-
}
363-
364357
FuncDecl *
365358
SILGenModule::getAsyncLetStart() {
366359
return lookupConcurrencyIntrinsic(getASTContext(),

lib/SILGen/SILGen.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor<SILGenModule> {
119119

120120
Optional<ProtocolConformance *> NSErrorConformanceToError;
121121

122-
Optional<FuncDecl*> RunChildTask;
123-
124122
Optional<FuncDecl*> AsyncLetStart;
125123
Optional<FuncDecl*> AsyncLetGet;
126124
Optional<FuncDecl*> AsyncLetGetThrowing;
@@ -497,9 +495,6 @@ class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor<SILGenModule> {
497495
/// Retrieve the _Concurrency._asyncLetEnd intrinsic.
498496
FuncDecl *getEndAsyncLet();
499497

500-
/// Retrieve the _Concurrency._runChildTask intrinsic.
501-
FuncDecl *getRunChildTask();
502-
503498
/// Retrieve the _Concurrency._taskFutureGet intrinsic.
504499
FuncDecl *getTaskFutureGet();
505500

lib/SILGen/SILGenApply.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5769,32 +5769,6 @@ ManagedValue SILGenFunction::emitAsyncLetStart(
57695769
return ManagedValue::forUnmanaged(apply);
57705770
}
57715771

5772-
ManagedValue SILGenFunction::emitRunChildTask(
5773-
SILLocation loc, Type functionType, ManagedValue taskFunction) {
5774-
auto runChildTaskFn = SGM.getRunChildTask();
5775-
5776-
Type resultType = functionType->castTo<FunctionType>()->getResult();
5777-
Type replacementTypes[] = {resultType};
5778-
auto subs = SubstitutionMap::get(runChildTaskFn->getGenericSignature(),
5779-
replacementTypes,
5780-
ArrayRef<ProtocolConformanceRef>{});
5781-
5782-
CanType origParamType = runChildTaskFn->getParameters()->get(0)
5783-
->getInterfaceType()->getCanonicalType();
5784-
CanType substParamType = origParamType.subst(subs)->getCanonicalType();
5785-
5786-
// Ensure that the closure has the appropriate type.
5787-
AbstractionPattern origParam(
5788-
runChildTaskFn->getGenericSignature().getCanonicalSignature(),
5789-
origParamType);
5790-
taskFunction = emitSubstToOrigValue(
5791-
loc, taskFunction, origParam, substParamType);
5792-
5793-
return emitApplyOfLibraryIntrinsic(
5794-
loc, runChildTaskFn, subs, {taskFunction}, SGFContext()
5795-
).getScalarValue();
5796-
}
5797-
57985772
ManagedValue SILGenFunction::emitCancelAsyncTask(
57995773
SILLocation loc, SILValue task) {
58005774
ASTContext &ctx = getASTContext();

lib/SILGen/SILGenFunction.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,9 +1369,6 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
13691369
ArgumentSource &&value,
13701370
bool isOnSelfParameter);
13711371

1372-
ManagedValue emitRunChildTask(
1373-
SILLocation loc, Type functionType, ManagedValue taskFunction);
1374-
13751372
ManagedValue emitAsyncLetStart(
13761373
SILLocation loc, Type functionType, ManagedValue taskFunction);
13771374

stdlib/public/Concurrency/Task.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -728,37 +728,13 @@ public func _taskFutureGet<T>(_ task: Builtin.NativeObject) async -> T
728728
@_silgen_name("swift_task_future_wait_throwing")
729729
public func _taskFutureGetThrowing<T>(_ task: Builtin.NativeObject) async throws -> T
730730

731-
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
732-
public func _runChildTask<T>(
733-
operation: @Sendable @escaping () async throws -> T
734-
) async -> Builtin.NativeObject {
735-
assert(false);
736-
let currentTask = Builtin.getCurrentAsyncTask()
737-
738-
// Set up the job flags for a new task.
739-
var flags = Task.JobFlags()
740-
flags.kind = .task
741-
flags.priority = getJobFlags(currentTask).priority
742-
flags.isFuture = true
743-
flags.isChildTask = true
744-
745-
// Create the asynchronous task future.
746-
let (task, _) = Builtin.createAsyncTaskFuture(flags.bits, operation)
747-
748-
// Enqueue the resulting job.
749-
_enqueueJobGlobal(Builtin.convertTaskToJob(task))
750-
751-
return task
752-
}
753-
754731
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
755732
@_silgen_name("swift_task_cancel")
756733
func _taskCancel(_ task: Builtin.NativeObject)
757734

758735
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
759736
@_silgen_name("swift_task_isCancelled")
760737
func _taskIsCancelled(_ task: Builtin.NativeObject) -> Bool
761-
/// Attach child task to the parent (current) task.
762738

763739
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
764740
@usableFromInline

0 commit comments

Comments
 (0)