Strangely enough, name of ObjC class is not encoded into the
full encoding of the class which has an ivar of pointer to this
class. Its name is encoded in the type for the ivar in the
ivar-list metadata. This patch conforms to the above rule.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61282 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index c50a021..d03ed41 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1795,10 +1795,12 @@
     }
     else if (PointeeTy->isObjCInterfaceType()) {
       S += '@';
-      ObjCInterfaceDecl *OI = PointeeTy->getAsObjCInterfaceType()->getDecl();
-      S += '"';
-      S += OI->getNameAsCString();
-      S += '"';
+      if (FD) {
+        ObjCInterfaceDecl *OI = PointeeTy->getAsObjCInterfaceType()->getDecl();
+        S += '"';
+        S += OI->getNameAsCString();
+        S += '"';
+      }
       return;
     } else if (isObjCClassType(PointeeTy)) {
       S += '#';