@@ -31,18 +31,6 @@ class NominalTypeDecl;
3131class SubstitutionMap ;
3232class AbstractFunctionDecl ;
3333class AbstractClosureExpr ;
34- class ClosureActorIsolation ;
35-
36- // / Trampoline for AbstractClosureExpr::getActorIsolation.
37- ClosureActorIsolation
38- __AbstractClosureExpr_getActorIsolation (AbstractClosureExpr *CE);
39-
40- // / Returns a function reference to \c __AbstractClosureExpr_getActorIsolation.
41- // / This is needed so we can use it as a default argument for
42- // / \c getActorIsolationOfContext without knowing the layout of
43- // / \c ClosureActorIsolation.
44- llvm::function_ref<ClosureActorIsolation(AbstractClosureExpr *)>
45- _getRef__AbstractClosureExpr_getActorIsolation ();
4634
4735// / Determine whether the given types are (canonically) equal, declared here
4836// / to avoid having to include Types.h.
@@ -100,6 +88,11 @@ class ActorIsolation {
10088 parameterIndex (0 ) { }
10189
10290public:
91+ // No-argument constructor needed for DenseMap use in PostfixCompletion.cpp
92+ explicit ActorIsolation (Kind kind = Unspecified)
93+ : pointer(nullptr ), kind(kind), isolatedByPreconcurrency(false ),
94+ parameterIndex(0 ) { }
95+
10396 static ActorIsolation forUnspecified () {
10497 return ActorIsolation (Unspecified, nullptr );
10598 }
@@ -157,7 +150,7 @@ class ActorIsolation {
157150
158151 NominalTypeDecl *getActor () const ;
159152
160- VarDecl *getCapturedActor () const ;
153+ VarDecl *getActorInstance () const ;
161154
162155 bool isGlobalActor () const {
163156 return getKind () == GlobalActor || getKind () == GlobalActorUnsafe;
@@ -227,16 +220,19 @@ class ActorIsolation {
227220// / Determine how the given value declaration is isolated.
228221ActorIsolation getActorIsolation (ValueDecl *value);
229222
223+ // / Trampoline for AbstractClosureExpr::getActorIsolation.
224+ ActorIsolation
225+ __AbstractClosureExpr_getActorIsolation (AbstractClosureExpr *CE);
226+
230227// / Determine how the given declaration context is isolated.
231228// / \p getClosureActorIsolation allows the specification of actor isolation for
232229// / closures that haven't been saved been saved to the AST yet. This is useful
233230// / for solver-based code completion which doesn't modify the AST but stores the
234231// / actor isolation of closures in the constraint system solution.
235232ActorIsolation getActorIsolationOfContext (
236233 DeclContext *dc,
237- llvm::function_ref<ClosureActorIsolation(AbstractClosureExpr *)>
238- getClosureActorIsolation =
239- _getRef__AbstractClosureExpr_getActorIsolation());
234+ llvm::function_ref<ActorIsolation(AbstractClosureExpr *)>
235+ getClosureActorIsolation = __AbstractClosureExpr_getActorIsolation);
240236
241237// / Check if both the value, and context are isolated to the same actor.
242238bool isSameActorIsolated (ValueDecl *value, DeclContext *dc);
@@ -260,9 +256,9 @@ bool usesFlowSensitiveIsolation(AbstractFunctionDecl const *fn);
260256// / \return true if it is safe to drop the global-actor qualifier.
261257bool safeToDropGlobalActor (
262258 DeclContext *dc, Type globalActor, Type ty,
263- llvm::function_ref<ClosureActorIsolation (AbstractClosureExpr *)>
259+ llvm::function_ref<ActorIsolation (AbstractClosureExpr *)>
264260 getClosureActorIsolation =
265- _getRef__AbstractClosureExpr_getActorIsolation() );
261+ __AbstractClosureExpr_getActorIsolation );
266262
267263void simple_display (llvm::raw_ostream &out, const ActorIsolation &state);
268264
0 commit comments