Skip to content

Commit 3b2ceb7

Browse files
committed
Skip name= header if ObjCClass/Foreign TypeRef name is empty
A minor cosmetic change when dumping typerefs.
1 parent 5f169b4 commit 3b2ceb7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/swift/Reflection/TypeRef.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,15 @@ class PrintTypeRef : public TypeRefVisitor<PrintTypeRef, void> {
551551

552552
void visitForeignClassTypeRef(const ForeignClassTypeRef *F) {
553553
printHeader("foreign");
554-
printField("name", F->getName());
554+
if (!F->getName().empty())
555+
printField("name", F->getName());
555556
OS << ')';
556557
}
557558

558559
void visitObjCClassTypeRef(const ObjCClassTypeRef *OC) {
559560
printHeader("objective-c-class");
560-
printField("name", OC->getName());
561+
if (!OC->getName().empty())
562+
printField("name", OC->getName());
561563
OS << ')';
562564
}
563565

0 commit comments

Comments
 (0)