Skip to content

Commit c2a4ec0

Browse files
committed
Address review feedback.
1 parent ef6352c commit c2a4ec0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,21 +1323,21 @@ namespace {
13231323

13241324
printField(requirement.getKind(), Label::optional("kind"));
13251325

1326-
if (requirement.getKind() != RequirementKind::Layout &&
1327-
requirement.getSecondType()) {
1328-
if (Writer.isParsable()) {
1329-
// If this is a conformance requirement, print the USR of the protocol
1330-
// decl instead of the type. The type USR for a protocol is based on
1331-
// the equivalent expanded existential, which drops suppressed
1332-
// protocols.
1333-
if (requirement.getKind() == RequirementKind::Conformance) {
1326+
if (requirement.getKind() != RequirementKind::Layout) {
1327+
// If this is a conformance requirement, print the USR of the protocol
1328+
// decl instead of the type. The type USR for a protocol is based on
1329+
// the equivalent expanded existential, which drops suppressed
1330+
// protocols.
1331+
switch (requirement.getKind()) {
1332+
case RequirementKind::Conformance:
1333+
if (Writer.isParsable()) {
13341334
printReferencedDeclField(requirement.getProtocolDecl(),
13351335
Label::optional("protocol"));
1336-
} else {
1337-
printTypeField(requirement.getSecondType(),
1338-
Label::optional("second_type"), opts);
1336+
break;
13391337
}
1340-
} else {
1338+
// Fallthrough to the original behavior for non-parsable output.
1339+
LLVM_FALLTHROUGH;
1340+
default:
13411341
printTypeField(requirement.getSecondType(),
13421342
Label::optional("second_type"), opts);
13431343
}
@@ -2022,8 +2022,8 @@ namespace {
20222022
Label::always("conformances"));
20232023

20242024
if (auto CD = dyn_cast<ClassDecl>(DC); CD && CD->hasSuperclass()) {
2025-
printReferencedDeclField(CD->getSuperclassDecl(),
2026-
Label::always("superclass_decl_usr"));
2025+
printTypeField(CD->getSuperclass(),
2026+
Label::always("superclass_type"));
20272027
}
20282028

20292029
if (auto ED = dyn_cast<EnumDecl>(DC); ED && ED->hasRawType()) {

0 commit comments

Comments
 (0)