summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-01-28 20:41:15 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-01-28 20:41:15 +0000
commit33fa96244135d64e13d964401f3089c251a4aa0b (patch)
treea24542ba8443a77be4373c9d41545b2976323a15 /clang/lib/AST/ASTContext.cpp
parent559b63cbb94e7027fe73df929d63703a1a3bc0c9 (diff)
downloadbcm5719-llvm-33fa96244135d64e13d964401f3089c251a4aa0b.tar.gz
bcm5719-llvm-33fa96244135d64e13d964401f3089c251a4aa0b.zip
Objective-C. provide legacy encoding of *id and *Class types
instead of crashing. // rdar://15824769. llvm-svn: 200338
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index ad3bf5105dd..9ee624c98b3 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -5440,7 +5440,19 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
return;
}
- case Type::ObjCObject:
+ case Type::ObjCObject: {
+ // hack to match legacy encoding of *id and *Class
+ QualType Ty = getObjCObjectPointerType(CT);
+ if (Ty->isObjCIdType()) {
+ S += "{objc_object=}";
+ return;
+ }
+ else if (Ty->isObjCClassType()) {
+ S += "{objc_class=}";
+ return;
+ }
+ }
+
case Type::ObjCInterface: {
// Ignore protocol qualifiers when mangling at this level.
T = T->castAs<ObjCObjectType>()->getBaseType();
OpenPOWER on IntegriCloud