Skip to content

Commit bbc3c42

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. (cherry picked from commit c283ce1)
1 parent 0a3e134 commit bbc3c42

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
@@ -4839,8 +4839,6 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
48394839
if (useContext == defContext)
48404840
return false;
48414841

4842-
bool isolatedStateMayEscape = false;
4843-
48444842
auto useIsolation = getActorIsolationOfContext(
48454843
const_cast<DeclContext *>(useContext), getClosureActorIsolation);
48464844
if (useIsolation.isActorIsolated()) {
@@ -4858,16 +4856,6 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
48584856
if (ctx.LangOpts.hasFeature(Feature::GlobalActorIsolatedTypesUsability) &&
48594857
regionIsolationEnabled && useIsolation.isGlobalActor())
48604858
return false;
4861-
4862-
// If the local function is not Sendable, its isolation differs
4863-
// from that of the context, and both contexts are actor isolated,
4864-
// then capturing non-Sendable values allows the closure to stash
4865-
// those values into actor isolated state. The original context
4866-
// may also stash those values into isolated state, enabling concurrent
4867-
// access later on.
4868-
isolatedStateMayEscape =
4869-
(!regionIsolationEnabled &&
4870-
useIsolation.isActorIsolated() && defIsolation.isActorIsolated());
48714859
}
48724860

48734861
// Walk the context chain from the use to the definition.
@@ -4877,18 +4865,13 @@ bool ActorIsolationChecker::mayExecuteConcurrentlyWith(
48774865
if (closure->isSendable())
48784866
return true;
48794867

4880-
if (isolatedStateMayEscape)
4881-
return true;
48824868
}
48834869

48844870
if (auto func = dyn_cast<FuncDecl>(useContext)) {
48854871
if (func->isLocalCapture()) {
48864872
// If the function is @Sendable... it can be run concurrently.
48874873
if (func->isSendable())
48884874
return true;
4889-
4890-
if (isolatedStateMayEscape)
4891-
return true;
48924875
}
48934876
}
48944877

0 commit comments

Comments
 (0)