diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-19 23:36:06 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-02-19 23:36:06 +0000 |
commit | a223cca7751637f8ec1a860010c4148757fb4752 (patch) | |
tree | 60193143319e1383c01de464d0bbe664075cc5a3 /lib/AST/ASTContext.cpp | |
parent | 83aa61f600456228d4087d7cf160708453b9c9b0 (diff) |
More objc's gc ir-gen stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65077 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 5c02100ec4..b8c74e1396 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2417,9 +2417,14 @@ QualType::GCAttrTypes ASTContext::getObjCGCAttrKind(const QualType &Ty) const { getLangOptions().getGCMode() != LangOptions::NonGC) { GCAttrs = Ty.getObjCGCAttr(); // Default behavious under objective-c's gc is for objective-c pointers - // be treated as though they were declared as __strong. - if (GCAttrs == QualType::GCNone && isObjCObjectPointerType(Ty)) - GCAttrs = QualType::Strong; + // (or pointers to them) be treated as though they were declared + // as __strong. + if (GCAttrs == QualType::GCNone) { + if (isObjCObjectPointerType(Ty)) + GCAttrs = QualType::Strong; + else if (Ty->isPointerType()) + return getObjCGCAttrKind(Ty->getAsPointerType()->getPointeeType()); + } } return GCAttrs; } |