File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
include/swift/SILOptimizer/Utils Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,35 @@ class IsolationRegionInfo {
286286 return false ;
287287 }
288288 }
289+
290+ void Profile (llvm::FoldingSetNodeID &id) const {
291+ id.AddInteger (getKind ());
292+ switch (getKind ()) {
293+ case Unknown:
294+ case Disconnected:
295+ return ;
296+ case Task:
297+ id.AddPointer (getTaskIsolatedValue ());
298+ return ;
299+ case Actor:
300+ // We profile in integer cases here so that we can always distinguish in
301+ // between the various cases and the non-case. Just being paranoid.
302+ if (hasActorIsolation ()) {
303+ if (auto isolation = getActorIsolation ()) {
304+ id.AddInteger (1 );
305+ return isolation->Profile (id);
306+ }
307+ }
308+
309+ if (hasActorInstance ()) {
310+ id.AddInteger (2 );
311+ return id.AddPointer (getActorInstance ());
312+ }
313+
314+ id.AddInteger (3 );
315+ break ;
316+ }
317+ }
289318};
290319
291320} // namespace swift
You can’t perform that action at this time.
0 commit comments