File tree Expand file tree Collapse file tree 2 files changed +30
-33
lines changed Expand file tree Collapse file tree 2 files changed +30
-33
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,36 @@ class ActorIsolation {
284
284
}
285
285
286
286
void printForDiagnostics (llvm::raw_ostream &os,
287
- StringRef openingQuotationMark = " '" ) const ;
287
+ StringRef openingQuotationMark = " '" ) const {
288
+ switch (*this ) {
289
+ case ActorIsolation::ActorInstance:
290
+ os << " actor-isolated" ;
291
+ break ;
292
+
293
+ case ActorIsolation::GlobalActor: {
294
+ if (isMainActor ()) {
295
+ os << " main actor-isolated" ;
296
+ } else {
297
+ Type globalActor = getGlobalActor ();
298
+ os << " global actor " << openingQuotationMark << globalActor.getString ()
299
+ << openingQuotationMark << " -isolated" ;
300
+ }
301
+ break ;
302
+ }
303
+ case ActorIsolation::Erased:
304
+ os << " @isolated(any)" ;
305
+ break ;
306
+
307
+ case ActorIsolation::Nonisolated:
308
+ case ActorIsolation::NonisolatedUnsafe:
309
+ case ActorIsolation::Unspecified:
310
+ os << " nonisolated" ;
311
+ if (*this == ActorIsolation::NonisolatedUnsafe) {
312
+ os << " (unsafe)" ;
313
+ }
314
+ break ;
315
+ }
316
+ }
288
317
289
318
SWIFT_DEBUG_DUMP {
290
319
print (llvm::dbgs ());
Original file line number Diff line number Diff line change @@ -1684,38 +1684,6 @@ ActorIsolation ActorIsolation::subst(SubstitutionMap subs) const {
1684
1684
llvm_unreachable (" unhandled actor isolation kind!" );
1685
1685
}
1686
1686
1687
- void ActorIsolation::printForDiagnostics (llvm::raw_ostream &os,
1688
- StringRef openingQuotationMark) const {
1689
- switch (*this ) {
1690
- case ActorIsolation::ActorInstance:
1691
- os << " actor-isolated" ;
1692
- break ;
1693
-
1694
- case ActorIsolation::GlobalActor: {
1695
- if (isMainActor ()) {
1696
- os << " main actor-isolated" ;
1697
- } else {
1698
- Type globalActor = getGlobalActor ();
1699
- os << " global actor " << openingQuotationMark << globalActor.getString ()
1700
- << openingQuotationMark << " -isolated" ;
1701
- }
1702
- break ;
1703
- }
1704
- case ActorIsolation::Erased:
1705
- os << " @isolated(any)" ;
1706
- break ;
1707
-
1708
- case ActorIsolation::Nonisolated:
1709
- case ActorIsolation::NonisolatedUnsafe:
1710
- case ActorIsolation::Unspecified:
1711
- os << " nonisolated" ;
1712
- if (*this == ActorIsolation::NonisolatedUnsafe) {
1713
- os << " (unsafe)" ;
1714
- }
1715
- break ;
1716
- }
1717
- }
1718
-
1719
1687
void swift::simple_display (
1720
1688
llvm::raw_ostream &out, const ActorIsolation &state) {
1721
1689
if (state.preconcurrency ())
You can’t perform that action at this time.
0 commit comments