Skip to content

Commit a61adac

Browse files
committed
Remove CreateAsyncTaskFuture and swift_task_create_future.
We no longer need these entry points.
1 parent c7edfa3 commit a61adac

File tree

15 files changed

+11
-105
lines changed

15 files changed

+11
-105
lines changed

include/swift/AST/Builtins.def

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -816,17 +816,6 @@ BUILTIN_MISC_OPERATION_WITH_SILGEN(EndAsyncLet, "endAsyncLet", "", Special)
816816
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTask,
817817
"createAsyncTask", "", Special)
818818

819-
/// createAsyncTaskFuture(): (
820-
/// Int, // flags
821-
/// Builtin.RawPointer?, // options (TaskOptionRecord*)
822-
/// @escaping () async throws -> T // function
823-
/// ) -> Builtin.NativeObject
824-
///
825-
/// Create a new asynchronous task future, given flags, an (optional) parent
826-
/// task and a function to execute.
827-
BUILTIN_MISC_OPERATION_WITH_SILGEN(CreateAsyncTaskFuture,
828-
"createAsyncTaskFuture", "", Special)
829-
830819
/// createAsyncTaskGroupFuture(): (
831820
/// Int, // flags
832821
/// Builtin.RawPointer?, // group

include/swift/Runtime/Concurrency.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ AsyncTaskAndContext swift_task_create_common(
6767
FutureAsyncSignature::FunctionType *function, void *closureContext,
6868
size_t initialContextSize);
6969

70-
/// Create a task object with a future which will run the given closure.
71-
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
72-
AsyncTaskAndContext swift_task_create_future(
73-
size_t flags,
74-
TaskOptionRecord *options,
75-
const Metadata *futureResultType,
76-
void *closureEntryPoint, HeapObject * /* +1 */ closureContext);
77-
7870
/// Create a task object with a future which will run the given
7971
/// closure, and offer its result to the task group
8072
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)

include/swift/Runtime/RuntimeFunctions.def

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,22 +1547,6 @@ FUNCTION(TaskCancel,
15471547
ARGS(SwiftTaskPtrTy),
15481548
ATTRS(NoUnwind, ArgMemOnly))
15491549

1550-
// AsyncTaskAndContext swift_task_create_future(
1551-
// size_t flags,
1552-
// TaskOptionRecord *options,
1553-
// const Metadata *futureResultType,
1554-
// void *closureEntry, HeapObject *closureContext);
1555-
FUNCTION(TaskCreateFuture,
1556-
swift_task_create_future, SwiftCC,
1557-
ConcurrencyAvailability,
1558-
RETURNS(AsyncTaskAndContextTy),
1559-
ARGS(SizeTy,
1560-
SwiftTaskOptionRecordPtrTy,
1561-
TypeMetadataPtrTy,
1562-
Int8PtrTy,
1563-
RefCountedPtrTy),
1564-
ATTRS(NoUnwind, ArgMemOnly))
1565-
15661550
// AsyncTaskAndContext swift_task_create_group_future(
15671551
// size_t flags,
15681552
// TaskGroup *group,

lib/AST/Builtins.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2762,7 +2762,6 @@ ValueDecl *swift::getBuiltinValueDecl(ASTContext &Context, Identifier Id) {
27622762
return getCancelAsyncTask(Context, Id);
27632763

27642764
case BuiltinValueKind::CreateAsyncTask:
2765-
case BuiltinValueKind::CreateAsyncTaskFuture:
27662765
return getCreateAsyncTask(Context, Id);
27672766

27682767
case BuiltinValueKind::CreateAsyncTaskGroupFuture:

lib/IRGen/GenBuiltin.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,6 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
271271
}
272272

273273
if (Builtin.ID == BuiltinValueKind::CreateAsyncTask ||
274-
Builtin.ID == BuiltinValueKind::CreateAsyncTaskFuture ||
275274
Builtin.ID == BuiltinValueKind::CreateAsyncTaskGroupFuture) {
276275

277276
auto flags = args.claimNext();
@@ -286,7 +285,6 @@ void irgen::emitBuiltinCall(IRGenFunction &IGF, const BuiltinInfo &Builtin,
286285

287286
auto newTaskAndContext = emitTaskCreate(
288287
IGF,
289-
Builtin.ID == BuiltinValueKind::CreateAsyncTask,
290288
flags,
291289
taskGroup,
292290
taskOptions,

lib/IRGen/GenCall.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3859,7 +3859,6 @@ void irgen::emitTaskCancel(IRGenFunction &IGF, llvm::Value *task) {
38593859

38603860
llvm::Value *irgen::emitTaskCreate(
38613861
IRGenFunction &IGF,
3862-
bool isCreateAsyncTask,
38633862
llvm::Value *flags,
38643863
llvm::Value *taskGroup,
38653864
llvm::Value *taskOptions,
@@ -3882,8 +3881,7 @@ llvm::Value *irgen::emitTaskCreate(
38823881
taskFunction, localContextInfo});
38833882
} else if (futureResultType) {
38843883
result = IGF.Builder.CreateCall(
3885-
isCreateAsyncTask ? IGF.IGM.getTaskCreateFn()
3886-
: IGF.IGM.getTaskCreateFutureFn(),
3884+
IGF.IGM.getTaskCreateFn(),
38873885
{flags,
38883886
taskOptions,
38893887
futureResultType,

lib/IRGen/GenCall.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,10 @@ namespace irgen {
224224

225225
void emitTaskCancel(IRGenFunction &IGF, llvm::Value *task);
226226

227-
/// Emit a class to swift_task_create[_f] or swift_task_create_future[__f]
228-
/// with the given flags, parent task, and task function.
229-
///
230-
/// When \c futureResultType is non-null, calls the future variant to create
231-
/// a future.
227+
/// Emit a call to swift_task_create[_f] with the given flags, options, and
228+
/// task function.
232229
llvm::Value *emitTaskCreate(
233230
IRGenFunction &IGF,
234-
bool isCreateAsyncTask,
235231
llvm::Value *flags,
236232
llvm::Value *taskGroup,
237233
llvm::Value *taskOptions,

lib/SIL/IR/OperandOwnership.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -782,20 +782,6 @@ OperandOwnershipBuiltinClassifier::visitCreateAsyncTask(BuiltinInst *bi,
782782
return OperandOwnership::InteriorPointer;
783783
}
784784

785-
OperandOwnership
786-
OperandOwnershipBuiltinClassifier::visitCreateAsyncTaskFuture(BuiltinInst *bi,
787-
StringRef attr) {
788-
// The function operand is consumed by the new task.
789-
if (&op == &bi->getOperandRef(PARAMETER_INDEX_CREATE_ASYNC_TASK_FUTURE_FUNCTION))
790-
return OperandOwnership::DestroyingConsume;
791-
792-
// FIXME: These are considered InteriorPointer because they may propagate a
793-
// pointer into a borrowed values. If they do not propagate an interior pointer,
794-
// then they should be InstantaneousUse instead and should not require a
795-
// guaranteed value.
796-
return OperandOwnership::InteriorPointer;
797-
}
798-
799785
OperandOwnership
800786
OperandOwnershipBuiltinClassifier::visitCreateAsyncTaskGroupFuture(BuiltinInst *bi,
801787
StringRef attr) {

lib/SIL/IR/ValueOwnership.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,6 @@ CONSTANT_OWNERSHIP_BUILTIN(None, GlobalStringTablePointer)
533533
CONSTANT_OWNERSHIP_BUILTIN(None, GetCurrentAsyncTask)
534534
CONSTANT_OWNERSHIP_BUILTIN(None, CancelAsyncTask)
535535
CONSTANT_OWNERSHIP_BUILTIN(Owned, CreateAsyncTask)
536-
CONSTANT_OWNERSHIP_BUILTIN(Owned, CreateAsyncTaskFuture)
537536
CONSTANT_OWNERSHIP_BUILTIN(Owned, CreateAsyncTaskGroupFuture)
538537
CONSTANT_OWNERSHIP_BUILTIN(None, ConvertTaskToJob)
539538
CONSTANT_OWNERSHIP_BUILTIN(None, InitializeDefaultActor)

lib/SIL/Utils/MemAccessUtils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,6 @@ static void visitBuiltinAddress(BuiltinInst *builtin,
18551855
case BuiltinValueKind::TSanInoutAccess:
18561856
case BuiltinValueKind::CancelAsyncTask:
18571857
case BuiltinValueKind::CreateAsyncTask:
1858-
case BuiltinValueKind::CreateAsyncTaskFuture:
18591858
case BuiltinValueKind::CreateAsyncTaskGroupFuture:
18601859
case BuiltinValueKind::AutoDiffCreateLinearMapContext:
18611860
case BuiltinValueKind::AutoDiffAllocateSubcontext:

0 commit comments

Comments
 (0)