Skip to content

Commit c283ce1

Browse files
committed
[Concurrency] Remove some dead code from mayExecuteConcurrentlyWith.
This code is no longer used given that region isolation is always enabled along with strict concurrency checking.
1 parent 4976be8 commit c283ce1

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4821,8 +4821,6 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
48214821
if (useContext == defContext)
48224822
return false;
48234823

4824-
bool isolatedStateMayEscape = false;
4825-
48264824
auto useIsolation = getActorIsolationOfContext(
48274825
const_cast<DeclContext *>(useContext), getClosureActorIsolation);
48284826
if (useIsolation.isActorIsolated()) {
@@ -4840,16 +4838,6 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
48404838
if (ctx.LangOpts.hasFeature(Feature::GlobalActorIsolatedTypesUsability) &&
48414839
regionIsolationEnabled && useIsolation.isGlobalActor())
48424840
return false;
4843-
4844-
// If the local function is not Sendable, its isolation differs
4845-
// from that of the context, and both contexts are actor isolated,
4846-
// then capturing non-Sendable values allows the closure to stash
4847-
// those values into actor-isolated state. The original context
4848-
// may also stash those values into isolated state, enabling concurrent
4849-
// access later on.
4850-
isolatedStateMayEscape =
4851-
(!regionIsolationEnabled &&
4852-
useIsolation.isActorIsolated() && defIsolation.isActorIsolated());
48534841
}
48544842

48554843
// Walk the context chain from the use to the definition.
@@ -4859,18 +4847,13 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
48594847
if (closure->isSendable())
48604848
return true;
48614849

4862-
if (isolatedStateMayEscape)
4863-
return true;
48644850
}
48654851

48664852
if (auto func = dyn_cast<FuncDecl>(useContext)) {
48674853
if (func->isLocalCapture()) {
48684854
// If the function is @Sendable... it can be run concurrently.
48694855
if (func->isSendable())
48704856
return true;
4871-
4872-
if (isolatedStateMayEscape)
4873-
return true;
48744857
}
48754858
}
48764859

0 commit comments

Comments
 (0)