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

llvm-svn: 57674
This commit is contained in:
Daniel Dunbar 2008-10-17 06:22:57 +00:00
parent 08acb24225
commit 40cac777b9
1 changed files with 6 additions and 1 deletions

View File

@ -1679,7 +1679,12 @@ void ASTContext::getObjCEncodingForType(QualType T, std::string& S,
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) {