Several@encode bug fixes for ObjC.

llvm-svn: 61231
This commit is contained in:
Fariborz Jahanian 2008-12-19 00:14:49 +00:00
parent 4e15d97ae4
commit 781c5c879c
1 changed files with 10 additions and 2 deletions

View File

@ -1779,9 +1779,17 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
}
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 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
S += '^';
getObjCEncodingForTypeImpl(PT->getPointeeType(), S,
false, ExpandPointedToStructures,
NameFields);
false);
} else if (const ArrayType *AT =
// Ignore type qualifiers etc.
dyn_cast<ArrayType>(T->getCanonicalTypeInternal())) {