Anonymous structures print as '?=' in Obj-C type encoding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57674 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 8d9dceb..673eb7b 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1679,7 +1679,12 @@
     bool inlining = (S.size() == 1 && S[0] == '^' ||
                      S.size() > 1 && S[S.size()-1] != '^');
     S += '{';
-    S += RDecl->getName();
+    // Anonymous structures print as '?'
+    if (const IdentifierInfo *II = RDecl->getIdentifier()) {
+      S += II->getName();
+    } else {
+      S += '?';
+    }
     bool found = false;
     for (unsigned i = 0, e = ERType.size(); i != e; ++i)
       if (ERType[i] == RTy) {