File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1980,8 +1980,11 @@ class SourceFileScope {
1980
1980
// emitAsyncMainThreadStart will create argc and argv.
1981
1981
// Just set the main actor as the expected executor; we should
1982
1982
// already be running on it.
1983
+ SILValue executor = sgm.TopLevelSGF ->emitMainExecutor (prologueLoc);
1983
1984
sgm.TopLevelSGF ->ExpectedExecutor =
1984
- sgm.TopLevelSGF ->emitMainExecutor (prologueLoc);
1985
+ sgm.TopLevelSGF ->B .createOptionalSome (
1986
+ prologueLoc, executor,
1987
+ SILType::getOptionalType (executor->getType ()));
1985
1988
} else {
1986
1989
// Create the argc and argv arguments.
1987
1990
auto entry = sgm.TopLevelSGF ->B .getInsertionBB ();
Original file line number Diff line number Diff line change 8
8
// CHECK-NEXT: // function_ref
9
9
// CHECK-NEXT: [[GET_MAIN:%.*]] = function_ref @swift_task_getMainExecutor
10
10
// CHECK-NEXT: [[MAIN:%.*]] = apply [[GET_MAIN]]()
11
+ // CHECK-NEXT: [[MAIN_OPTIONAL:%[0-9]+]] = enum $Optional<Builtin.Executor>, #Optional.some!enumelt, [[MAIN]]
11
12
12
13
actor MyActorImpl { }
13
14
@@ -67,7 +68,7 @@ await printFromMyActor(value: a)
67
68
// CHECK: [[ACTORREF:%[0-9]+]] = begin_borrow {{%[0-9]+}} : $MyActorImpl
68
69
// CHECK: hop_to_executor [[ACTORREF]] : $MyActorImpl
69
70
// CHECK: {{%[0-9]+}} = apply [[PRINTFROMMYACTOR_FUNC]]([[AGLOBAL]])
70
- // CHECK: hop_to_executor [[MAIN ]]
71
+ // CHECK: hop_to_executor [[MAIN_OPTIONAL ]]
71
72
// CHECK: end_borrow [[ACTORREF]]
72
73
73
74
if a < 10 {
@@ -121,6 +122,6 @@ if a < 10 {
121
122
// CHECK: [[ACTORREF:%[0-9]+]] = begin_borrow {{%[0-9]+}} : $MyActorImpl
122
123
// CHECK: hop_to_executor [[ACTORREF]] : $MyActorImpl
123
124
// CHECK: {{%[0-9]+}} = apply [[PRINTFROMMYACTOR_FUNC]]([[AGLOBAL]])
124
- // CHECK: hop_to_executor [[MAIN ]]
125
+ // CHECK: hop_to_executor [[MAIN_OPTIONAL ]]
125
126
// CHECK: end_borrow [[ACTORREF]]
126
127
}
You can’t perform that action at this time.
0 commit comments