aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-12-23 21:30:15 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-12-23 21:30:15 +0000
commit3e1b16c2e5b2c02d76e60ff28d609eeb21a2eb71 (patch)
tree7d253c0ecc261542ce8e8e87f2ffc7ead3081db3 /lib/AST/ASTContext.cpp
parent6ed40e351a7c1fb3084434f1db19216b79623cf0 (diff)
Last patch, for now, to privde ObjC's encoding of types.
We now pass all gcc's encoding compatibility tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r--lib/AST/ASTContext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index b9514f35a0..c5b451740a 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -1859,6 +1859,16 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
return;
}
else if (PointeeTy->isObjCInterfaceType()) {
+ if (dyn_cast<TypedefType>(PointeeTy.getTypePtr())) {
+ // Another historical/compatibility reason.
+ // We encode the underlying type which comes out as
+ // {...};
+ S += '^';
+ getObjCEncodingForTypeImpl(PointeeTy, S,
+ false, ExpandPointedToStructures,
+ NULL);
+ return;
+ }
S += '@';
if (FD) {
ObjCInterfaceDecl *OI = PointeeTy->getAsObjCInterfaceType()->getDecl();