@@ -640,6 +640,21 @@ static StringRef getDumpString(ExplicitSafety safety) {
640640 return " unsafe" ;
641641 }
642642}
643+ static StringRef getDumpString (ConformanceEntryKind kind) {
644+ switch (kind) {
645+ case ConformanceEntryKind::Inherited:
646+ return " inherited" ;
647+ case ConformanceEntryKind::Explicit:
648+ return " explicit" ;
649+ case ConformanceEntryKind::PreMacroExpansion:
650+ return " pre_macro_expansion" ;
651+ case ConformanceEntryKind::Synthesized:
652+ return " synthesized" ;
653+ case ConformanceEntryKind::Implied:
654+ return " implied" ;
655+ }
656+ llvm_unreachable (" unhandled ConformanceEntryKind" );
657+ }
643658static StringRef getDumpString (StringRef s) {
644659 return s;
645660}
@@ -1263,6 +1278,40 @@ namespace {
12631278 void printRec (const ProtocolConformance *conformance,
12641279 VisitedConformances &visited, Label label);
12651280
1281+ // Print a field that describes the actor isolation associated with an AST
1282+ // node.
1283+ void printIsolation (const ActorIsolation &isolation) {
1284+ switch (isolation) {
1285+ case ActorIsolation::Unspecified:
1286+ case ActorIsolation::NonisolatedUnsafe:
1287+ break ;
1288+
1289+ case ActorIsolation::Nonisolated:
1290+ printFlag (true , " nonisolated" , CapturesColor);
1291+ break ;
1292+
1293+ case ActorIsolation::Erased:
1294+ printFlag (true , " dynamically_isolated" , CapturesColor);
1295+ break ;
1296+
1297+ case ActorIsolation::CallerIsolationInheriting:
1298+ printFlag (true , " isolated_to_caller_isolation" , CapturesColor);
1299+ break ;
1300+
1301+ case ActorIsolation::ActorInstance:
1302+ printReferencedDeclWithContextField (isolation.getActorInstance (),
1303+ Label::always (" actor_isolated" ),
1304+ CapturesColor);
1305+ break ;
1306+
1307+ case ActorIsolation::GlobalActor:
1308+ printTypeField (isolation.getGlobalActor (),
1309+ Label::always (" global_actor_isolated" ), PrintOptions (),
1310+ CapturesColor);
1311+ break ;
1312+ }
1313+ }
1314+
12661315 // / Print a requirement node.
12671316 void visitRequirement (const Requirement &requirement, Label label) {
12681317 printHead (" requirement" , ASTNodeColor, label);
@@ -4021,36 +4070,7 @@ class PrintExpr : public ExprVisitor<PrintExpr, void, Label>,
40214070
40224071 printField (E->getRawDiscriminator (), Label::always (" discriminator" ),
40234072 DiscriminatorColor);
4024-
4025- switch (auto isolation = E->getActorIsolation ()) {
4026- case ActorIsolation::Unspecified:
4027- case ActorIsolation::NonisolatedUnsafe:
4028- break ;
4029-
4030- case ActorIsolation::Nonisolated:
4031- printFlag (true , " nonisolated" , CapturesColor);
4032- break ;
4033-
4034- case ActorIsolation::Erased:
4035- printFlag (true , " dynamically_isolated" , CapturesColor);
4036- break ;
4037-
4038- case ActorIsolation::CallerIsolationInheriting:
4039- printFlag (true , " isolated_to_caller_isolation" , CapturesColor);
4040- break ;
4041-
4042- case ActorIsolation::ActorInstance:
4043- printReferencedDeclWithContextField (isolation.getActorInstance (),
4044- Label::always (" actor_isolated" ),
4045- CapturesColor);
4046- break ;
4047-
4048- case ActorIsolation::GlobalActor:
4049- printTypeField (isolation.getGlobalActor (),
4050- Label::always (" global_actor_isolated" ), PrintOptions (),
4051- CapturesColor);
4052- break ;
4053- }
4073+ printIsolation (E->getActorIsolation ());
40544074
40554075 if (auto captureInfo = E->getCachedCaptureInfo ()) {
40564076 printCaptureInfoField (captureInfo, Label::optional (" captures" ));
@@ -5616,6 +5636,11 @@ class PrintConformance : public PrintBase {
56165636 printTypeField (conformance->getType (), Label::always (" type" ));
56175637 printReferencedDeclField (conformance->getProtocol (),
56185638 Label::always (" protocol" ));
5639+ if (isTypeChecked ()) {
5640+ printField (conformance->getSourceKind (), Label::always (" source_kind" ));
5641+ printFlag (conformance->isRetroactive (), " retroactive" );
5642+ printIsolation (conformance->getIsolation ());
5643+ }
56195644 if (!Writer.isParsable ())
56205645 printFlag (!shouldPrintDetails, " <details printed above>" );
56215646 };
@@ -5625,6 +5650,16 @@ class PrintConformance : public PrintBase {
56255650 auto normal = cast<NormalProtocolConformance>(conformance);
56265651
56275652 printCommon (" normal_conformance" );
5653+ printFlag (normal->isPreconcurrency (), " preconcurrency" );
5654+ if (normal->isPreconcurrency () && normal->isComplete ()) {
5655+ printFlag (normal->isPreconcurrencyEffectful (),
5656+ " effectful_preconcurrency" );
5657+ }
5658+ printFlag (normal->isRetroactive (), " retroactive" );
5659+ printFlag (normal->isUnchecked (), " unchecked" );
5660+ if (normal->getExplicitSafety () != ExplicitSafety::Unspecified)
5661+ printField (normal->getExplicitSafety (), Label::always (" safety" ));
5662+
56285663 if (!shouldPrintDetails)
56295664 break ;
56305665
0 commit comments