aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-12-19 00:14:49 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-12-19 00:14:49 +0000
commitc166d7390c300e84a0001c016b83f8aa6de9cf53 (patch)
treeccd2c62325bd9e1824229f9fb8c74fa92273e5c5 /lib/AST/ASTContext.cpp
parent730165dc049224e4af8de2bf6fa281bbce9cf4bc (diff)
Several@encode bug fixes for ObjC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 95f95ceb5e..a91679e594 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -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())) {