Skip to content

Commit

Permalink
Skip name= header if ObjCClass/Foreign TypeRef name is empty
Browse files Browse the repository at this point in the history
A minor cosmetic change when dumping typerefs.
  • Loading branch information
bitjammer committed Mar 5, 2016
1 parent 5f169b4 commit 3b2ceb7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/swift/Reflection/TypeRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,15 @@ class PrintTypeRef : public TypeRefVisitor<PrintTypeRef, void> {

void visitForeignClassTypeRef(const ForeignClassTypeRef *F) {
printHeader("foreign");
printField("name", F->getName());
if (!F->getName().empty())
printField("name", F->getName());
OS << ')';
}

void visitObjCClassTypeRef(const ObjCClassTypeRef *OC) {
printHeader("objective-c-class");
printField("name", OC->getName());
if (!OC->getName().empty())
printField("name", OC->getName());
OS << ')';
}

Expand Down

0 comments on commit 3b2ceb7

Please sign in to comment.