Skip to content

Commit eed96d2

Browse files
committed
[AsyncLet] remove runChild; it is now asyncLetStart
1 parent d3c5ebc commit eed96d2

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
@@ -5793,32 +5793,6 @@ ManagedValue SILGenFunction::emitAsyncLetStart(
57935793
return ManagedValue::forUnmanaged(apply);
57945794
}
57955795

5796-
ManagedValue SILGenFunction::emitRunChildTask(
5797-
SILLocation loc, Type functionType, ManagedValue taskFunction) {
5798-
auto runChildTaskFn = SGM.getRunChildTask();
5799-
5800-
Type resultType = functionType->castTo<FunctionType>()->getResult();
5801-
Type replacementTypes[] = {resultType};
5802-
auto subs = SubstitutionMap::get(runChildTaskFn->getGenericSignature(),
5803-
replacementTypes,
5804-
ArrayRef<ProtocolConformanceRef>{});
5805-
5806-
CanType origParamType = runChildTaskFn->getParameters()->get(0)
5807-
->getInterfaceType()->getCanonicalType();
5808-
CanType substParamType = origParamType.subst(subs)->getCanonicalType();
5809-
5810-
// Ensure that the closure has the appropriate type.
5811-
AbstractionPattern origParam(
5812-
runChildTaskFn->getGenericSignature().getCanonicalSignature(),
5813-
origParamType);
5814-
taskFunction = emitSubstToOrigValue(
5815-
loc, taskFunction, origParam, substParamType);
5816-
5817-
return emitApplyOfLibraryIntrinsic(
5818-
loc, runChildTaskFn, subs, {taskFunction}, SGFContext()
5819-
).getScalarValue();
5820-
}
5821-
58225796
ManagedValue SILGenFunction::emitCancelAsyncTask(
58235797
SILLocation loc, SILValue task) {
58245798
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
@@ -724,37 +724,13 @@ public func _taskFutureGet<T>(_ task: Builtin.NativeObject) async -> T
724724
@_silgen_name("swift_task_future_wait_throwing")
725725
public func _taskFutureGetThrowing<T>(_ task: Builtin.NativeObject) async throws -> T
726726

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

754731
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
755732
@_silgen_name("swift_task_isCancelled")
756733
func _taskIsCancelled(_ task: Builtin.NativeObject) -> Bool
757-
/// Attach child task to the parent (current) task.
758734

759735
@available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)
760736
@usableFromInline

0 commit comments

Comments
 (0)