@@ -640,6 +640,21 @@ static StringRef getDumpString(ExplicitSafety safety) {
640
640
return " unsafe" ;
641
641
}
642
642
}
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
+ }
643
658
static StringRef getDumpString (StringRef s) {
644
659
return s;
645
660
}
@@ -1263,6 +1278,40 @@ namespace {
1263
1278
void printRec (const ProtocolConformance *conformance,
1264
1279
VisitedConformances &visited, Label label);
1265
1280
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
+
1266
1315
// / Print a requirement node.
1267
1316
void visitRequirement (const Requirement &requirement, Label label) {
1268
1317
printHead (" requirement" , ASTNodeColor, label);
@@ -4021,36 +4070,7 @@ class PrintExpr : public ExprVisitor<PrintExpr, void, Label>,
4021
4070
4022
4071
printField (E->getRawDiscriminator (), Label::always (" discriminator" ),
4023
4072
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 ());
4054
4074
4055
4075
if (auto captureInfo = E->getCachedCaptureInfo ()) {
4056
4076
printCaptureInfoField (captureInfo, Label::optional (" captures" ));
@@ -5616,6 +5636,11 @@ class PrintConformance : public PrintBase {
5616
5636
printTypeField (conformance->getType (), Label::always (" type" ));
5617
5637
printReferencedDeclField (conformance->getProtocol (),
5618
5638
Label::always (" protocol" ));
5639
+ if (isTypeChecked ()) {
5640
+ printField (conformance->getSourceKind (), Label::always (" source_kind" ));
5641
+ printFlag (conformance->isRetroactive (), " retroactive" );
5642
+ printIsolation (conformance->getIsolation ());
5643
+ }
5619
5644
if (!Writer.isParsable ())
5620
5645
printFlag (!shouldPrintDetails, " <details printed above>" );
5621
5646
};
@@ -5625,6 +5650,16 @@ class PrintConformance : public PrintBase {
5625
5650
auto normal = cast<NormalProtocolConformance>(conformance);
5626
5651
5627
5652
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
+
5628
5663
if (!shouldPrintDetails)
5629
5664
break ;
5630
5665
0 commit comments