Skip to content

Commit 09003d6

Browse files
authored
Revert "Merge pull request #77609 from ktoso/wip-task-names" (#79562)
This reverts commit 4ab5d26.
1 parent 53b3460 commit 09003d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1068
-1151
lines changed

Runtimes/Core/Concurrency/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
add_subdirectory(InternalShims)
22

3-
gyb_expand(TaskGroup+addTask.swift.gyb TaskGroup+addTask.swift)
4-
53
add_library(swift_Concurrency
64
Actor.cpp
75
AsyncLet.cpp
@@ -79,11 +77,10 @@ add_library(swift_Concurrency
7977
Task+TaskExecutor.swift
8078
TaskCancellation.swift
8179
TaskGroup.swift
80+
TaskGroup+TaskExecutor.swift
8281
TaskLocal.swift
8382
TaskSleep.swift
84-
TaskSleepDuration.swift
85-
"${CMAKE_CURRENT_BINARY_DIR}/TaskGroup+addTask.swift")
86-
83+
TaskSleepDuration.swift)
8784
include(${SwiftCore_CONCURRENCY_GLOBAL_EXECUTOR}.cmake)
8885
target_compile_definitions(swift_Concurrency PRIVATE
8986
$<$<COMPILE_LANGUAGE:C,CXX>:-DSWIFT_TARGET_LIBRARY_NAME=swift_Concurrency>

include/swift/ABI/MetadataValues.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2730,7 +2730,6 @@ class JobFlags : public FlagSet<uint32_t> {
27302730
// 27 is currently unused
27312731
Task_IsAsyncLetTask = 28,
27322732
Task_HasInitialTaskExecutorPreference = 29,
2733-
Task_HasInitialTaskName = 30,
27342733
};
27352734
// clang-format on
27362735

@@ -2767,9 +2766,6 @@ class JobFlags : public FlagSet<uint32_t> {
27672766
FLAGSET_DEFINE_FLAG_ACCESSORS(Task_HasInitialTaskExecutorPreference,
27682767
task_hasInitialTaskExecutorPreference,
27692768
task_setHasInitialTaskExecutorPreference)
2770-
FLAGSET_DEFINE_FLAG_ACCESSORS(Task_HasInitialTaskName,
2771-
task_hasInitialTaskName,
2772-
task_setHasInitialTaskName)
27732769
};
27742770

27752771
/// Kinds of task status record.
@@ -2799,9 +2795,6 @@ enum class TaskStatusRecordKind : uint8_t {
27992795
/// enqueued on.
28002796
TaskExecutorPreference = 5,
28012797

2802-
/// A human-readable task name.
2803-
TaskName = 6,
2804-
28052798
// Kinds >= 192 are private to the implementation.
28062799
First_Reserved = 192,
28072800
Private_RecordLock = 192
@@ -2825,8 +2818,6 @@ enum class TaskOptionRecordKind : uint8_t {
28252818
/// Set the initial task executor preference of the task.
28262819
InitialTaskExecutorUnowned = 5,
28272820
InitialTaskExecutorOwned = 6,
2828-
// Set a human-readable task name.
2829-
InitialTaskName = 7,
28302821
/// Request a child task for swift_task_run_inline.
28312822
RunInline = UINT8_MAX,
28322823
};

include/swift/ABI/Task.h

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -421,28 +421,6 @@ class AsyncTask : public Job {
421421
/// Checking this is, of course, inherently race-prone on its own.
422422
bool isCancelled() const;
423423

424-
// ==== INITIAL TASK RECORDS =================================================
425-
// A task may have a number of "initial" records set, they MUST be set in the
426-
// following order to make the task-local allocation/deallocation's stack
427-
// discipline easy to work out at the tasks destruction:
428-
//
429-
// - Initial TaskName
430-
// - Initial ExecutorPreference
431-
432-
// ==== Task Naming ----------------------------------------------------------
433-
434-
/// At task creation a task may be assigned a name.
435-
void pushInitialTaskName(const char* taskName);
436-
void dropInitialTaskNameRecord();
437-
438-
/// Get the initial task name that was given to this task during creation,
439-
/// or nullptr if the task has no name
440-
const char* getTaskName();
441-
442-
bool hasInitialTaskNameRecord() const {
443-
return Flags.task_hasInitialTaskName();
444-
}
445-
446424
// ==== Task Executor Preference ---------------------------------------------
447425

448426
/// Get the preferred task executor reference if there is one set for this

include/swift/ABI/TaskOptions.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,6 @@ class InitialTaskExecutorOwnedPreferenceTaskOptionRecord
131131
}
132132
};
133133

134-
class InitialTaskNameTaskOptionRecord
135-
: public TaskOptionRecord {
136-
137-
const char* TaskName;
138-
139-
public:
140-
InitialTaskNameTaskOptionRecord(
141-
const char* taskName)
142-
: TaskOptionRecord(TaskOptionRecordKind::InitialTaskName),
143-
TaskName(taskName) {}
144-
145-
const char* getTaskName() const {
146-
return TaskName;
147-
}
148-
149-
static bool classof(const TaskOptionRecord *record) {
150-
return record->getKind() == TaskOptionRecordKind::InitialTaskName;
151-
}
152-
};
153-
154134
/// Task option to specify the initial serial executor for the task.
155135
class InitialSerialExecutorTaskOptionRecord : public TaskOptionRecord {
156136
const SerialExecutorRef Executor;

include/swift/ABI/TaskStatus.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -325,22 +325,6 @@ class TaskExecutorPreferenceStatusRecord : public TaskStatusRecord {
325325
}
326326
};
327327

328-
class TaskNameStatusRecord : public TaskStatusRecord {
329-
private:
330-
const char *Name;
331-
332-
public:
333-
TaskNameStatusRecord(const char *name)
334-
: TaskStatusRecord(TaskStatusRecordKind::TaskName),
335-
Name(name) {}
336-
337-
const char *getName() { return Name; }
338-
339-
static bool classof(const TaskStatusRecord *record) {
340-
return record->getKind() == TaskStatusRecordKind::TaskName;
341-
}
342-
};
343-
344328
// This record is allocated for a task to record what it is dependent on before
345329
// the task can make progress again.
346330
class TaskDependencyStatusRecord : public TaskStatusRecord {

include/swift/AST/ASTSynthesis.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ enum SingletonTypeSynthesizer {
5757
_taskExecutor, // the '_Concurrency.TaskExecutor' protocol
5858
_actor, // the '_Concurrency.Actor' protocol
5959
_distributedActor, // the 'Distributed.DistributedActor' protocol
60-
_unsafeRawBufferPointer // UnsafeRawBufferPointer
6160
};
6261
inline Type synthesizeType(SynthesisContext &SC,
6362
SingletonTypeSynthesizer kind) {
@@ -90,8 +89,6 @@ inline Type synthesizeType(SynthesisContext &SC,
9089
case _distributedActor:
9190
return SC.Context.getProtocol(KnownProtocolKind::DistributedActor)
9291
->getDeclaredInterfaceType();
93-
case _unsafeRawBufferPointer:
94-
return SC.Context.getUnsafeRawBufferPointerType();
9592
case _copyable:
9693
return SC.Context.getProtocol(KnownProtocolKind::Copyable)
9794
->getDeclaredInterfaceType();

include/swift/AST/Builtins.def

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,8 +954,7 @@ BUILTIN_MISC_OPERATION(UnprotectedAddressOfBorrowOpaque, "unprotectedAddressOfBo
954954
/// createTask<T>(flags: Int,
955955
/// initialSerialExecutor: (Builtin.Executor)? = nil,
956956
/// taskGroup: Builtin.RawPointer? = nil,
957-
/// initialTaskExecutorDeprecated: (Builtin.Executor)? = nil,
958-
/// initialTaskExecutorOwned: (any TaskExecutor)? = nil,
957+
/// initialTaskExecutor: (Builtin.Executor)? = nil,
959958
/// operation: sending @escaping () async throws -> T)
960959
/// -> Builtin.NativeObject, Builtin.RawPointer)
961960
///

include/swift/Basic/Features.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ BASELINE_LANGUAGE_FEATURE(BuiltinBuildExecutor, 0, "Executor-building builtins")
151151
BASELINE_LANGUAGE_FEATURE(BuiltinBuildComplexEqualityExecutor, 0, "Executor-building for 'complexEquality executor' builtins")
152152
BASELINE_LANGUAGE_FEATURE(BuiltinBuildMainExecutor, 0, "MainActor executor building builtin")
153153
BASELINE_LANGUAGE_FEATURE(BuiltinCreateAsyncTaskOwnedTaskExecutor, 0, "Task create with owned TaskExecutor")
154-
BASELINE_LANGUAGE_FEATURE(BuiltinCreateAsyncTaskName, 0, "Task create with a name")
155154
BASELINE_LANGUAGE_FEATURE(BuiltinCreateAsyncTaskInGroup, 0, "Task create in task group builtin with extra flags")
156155
BASELINE_LANGUAGE_FEATURE(BuiltinCreateAsyncTaskInGroupWithExecutor, 0, "Task create in task group builtin with extra flags")
157156
BASELINE_LANGUAGE_FEATURE(BuiltinCreateAsyncDiscardingTaskInGroup, 0, "Task create in discarding task group builtin, accounting for the Void return type")

include/swift/Runtime/Concurrency.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,6 @@ void swift_task_reportUnexpectedExecutor(
10221022
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
10231023
JobPriority swift_task_getCurrentThreadPriority(void);
10241024

1025-
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
1026-
const char *swift_task_getCurrentTaskName(void);
1027-
10281025
SWIFT_EXPORT_FROM(swift_Concurrency) SWIFT_CC(swift)
10291026
void swift_task_startOnMainActor(AsyncTask* job);
10301027

lib/AST/Builtins.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,6 @@ static ValueDecl *getCreateTask(ASTContext &ctx, Identifier id) {
15731573
_existential(_taskExecutor),
15741574
/*else*/ _executor))),
15751575
_nil)),
1576-
_label("taskName", _defaulted(_optional(_rawPointer), _nil)),
15771576
_label("operation",
15781577
_sending(_function(_async(_throws(_thick)), _typeparam(0),
15791578
_parameters())))),
@@ -1598,7 +1597,6 @@ static ValueDecl *getCreateDiscardingTask(ASTContext &ctx, Identifier id) {
15981597
_existential(_taskExecutor),
15991598
/*else*/ _executor))),
16001599
_nil)),
1601-
_label("taskName", _defaulted(_optional(_rawPointer), _nil)),
16021600
_label("operation", _sending(_function(_async(_throws(_thick)), _void,
16031601
_parameters())))),
16041602
_tuple(_nativeObject, _rawPointer));

0 commit comments

Comments
 (0)