Several@encode bug fixes for ObjC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61231 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 95f95ce..a91679e 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1779,9 +1779,17 @@
   }
   else if (const PointerType *PT = T->getAsPointerType()) {
     QualType PointeeTy = PT->getPointeeType();
-    if (isObjCIdType(PointeeTy) || PointeeTy->isObjCInterfaceType()) {
+    if (isObjCIdType(PointeeTy)) {
       S += '@';
       return;
+    }
+    else if (PointeeTy->isObjCInterfaceType()) {
+      S += '@';
+      ObjCInterfaceDecl *OI = PointeeTy->getAsObjCInterfaceType()->getDecl();
+      S += '"';
+      S += OI->getNameAsCString();
+      S += '"';
+      return;
     } else if (isObjCClassType(PointeeTy)) {
       S += '#';
       return;
@@ -1802,7 +1810,7 @@
     S += '^';
     getObjCEncodingForTypeImpl(PT->getPointeeType(), S, 
                                false, ExpandPointedToStructures, 
-                               NameFields);
+                               false);
   } else if (const ArrayType *AT =
                // Ignore type qualifiers etc.
                dyn_cast<ArrayType>(T->getCanonicalTypeInternal())) {