Skip to content

Commit a94727d

Browse files
committed
[ast] Teach ASTDumper how to dump FunctionTypeIsolation on a FunctionType.
Otherwise, it gets confusing when debugging in the debugger since dumpPrint will print out the function type isolation, but dump will not.
1 parent 90340a0 commit a94727d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6299,6 +6299,22 @@ namespace {
62996299
break;
63006300
}
63016301
}
6302+
auto isolation = T->getIsolation();
6303+
switch (isolation.getKind()) {
6304+
case FunctionTypeIsolation::Kind::NonIsolated:
6305+
case FunctionTypeIsolation::Kind::Parameter:
6306+
break;
6307+
case FunctionTypeIsolation::Kind::GlobalActor:
6308+
printRec(isolation.getGlobalActorType(),
6309+
Label::always("global_actor"));
6310+
break;
6311+
case FunctionTypeIsolation::Kind::Erased:
6312+
printFlag("@isolated(any)");
6313+
break;
6314+
case FunctionTypeIsolation::Kind::NonIsolatedCaller:
6315+
printFlag("@execution(caller)");
6316+
break;
6317+
}
63026318
}
63036319
if (Type globalActor = T->getGlobalActor()) {
63046320
printFieldQuoted(globalActor.getString(), Label::always("global_actor"));

0 commit comments

Comments
 (0)