Skip to content

Commit 5867219

Browse files
committed
Fix the serialization of Builtin.Executor
1 parent 6b36a9a commit 5867219

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

include/swift/Strings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_JOB = {
124124
"Builtin.Job"};
125125
/// The name of the Builtin type for ExecutorRef
126126
constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_EXECUTOR = {
127-
"Builtin.ExecutorRef"};
127+
"Builtin.Executor"};
128128
/// The name of the Builtin type for DefaultActorStorage
129129
constexpr static BuiltinNameStringLiteral BUILTIN_TYPE_NAME_DEFAULTACTORSTORAGE = {
130130
"Builtin.DefaultActorStorage"};

lib/AST/Builtins.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ Type swift::getBuiltinType(ASTContext &Context, StringRef Name) {
8585
return Context.TheJobType;
8686
if (Name == "DefaultActorStorage")
8787
return Context.TheDefaultActorStorageType;
88+
if (Name == "Executor")
89+
return Context.TheExecutorType;
8890
if (Name == "NativeObject")
8991
return Context.TheNativeObjectType;
9092
if (Name == "BridgeObject")

test/Serialization/Inputs/def_concurrency.sil

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,28 @@ actor Act { }
88
@_transparent public func serialize_all() {
99
}
1010

11-
// CHECK-LABEL: sil public_external [transparent] [serialized] @test_hop_to_executor
12-
sil [transparent] [serialized] @test_hop_to_executor : $@convention(thin) (@guaranteed Act) -> () {
11+
// CHECK-LABEL: sil public_external [transparent] [serialized] @test_hop_to_executor_actor
12+
sil [transparent] [serialized] @test_hop_to_executor_actor : $@convention(thin) (@guaranteed Act) -> () {
1313
bb0(%0 : $Act):
1414
// CHECK: hop_to_executor %0 : $Act
1515
hop_to_executor %0 : $Act
1616
%2 = tuple ()
1717
return %2 : $()
1818
}
1919

20+
// CHECK-LABEL: sil public_external [transparent] [serialized] @test_hop_to_executor_builtin
21+
sil [transparent] [serialized] @test_hop_to_executor_builtin : $@convention(thin) (@guaranteed Builtin.Executor) -> () {
22+
bb0(%0 : $Builtin.Executor):
23+
// CHECK: hop_to_executor %0 : $Builtin.Executor
24+
hop_to_executor %0 : $Builtin.Executor
25+
%2 = tuple ()
26+
return %2 : $()
27+
}
28+
2029
sil [transparent] [serialized] @$s15def_concurrency13serialize_allyyF : $@convention(thin) () -> () {
2130
bb0:
22-
%91 = function_ref @test_hop_to_executor : $@convention(thin) (@guaranteed Act) -> ()
31+
%0 = function_ref @test_hop_to_executor_actor : $@convention(thin) (@guaranteed Act) -> ()
32+
%1 = function_ref @test_hop_to_executor_builtin : $@convention(thin) (@guaranteed Builtin.Executor) -> ()
2333

2434
%r = tuple ()
2535
return %r : $()

0 commit comments

Comments
 (0)