diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-06 23:32:40 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-09-06 23:32:40 +0000 |
commit | 6dd3f39daeff5c14bf8cacad786d74463b800948 (patch) | |
tree | e77be937881f393b410508f9ecfc1a8120dddfd7 /clang/lib | |
parent | 5b5c953b07e25075815dd675064a269964e6f1a7 (diff) | |
download | bcm5719-llvm-6dd3f39daeff5c14bf8cacad786d74463b800948.tar.gz bcm5719-llvm-6dd3f39daeff5c14bf8cacad786d74463b800948.zip |
objc-gc: Adds support for "weak" property attribute under GC.
// rdar://10073896
llvm-svn: 139203
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 84052fd9d83..bf4939d9fd6 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -594,6 +594,12 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, ObjCPropertyDecl::PropertyAttributeKind kind = property->getPropertyAttributes(); QualType PropType = Context.getCanonicalType(property->getType()); + bool PropertyIsGCWeak = (kind & ObjCPropertyDecl::OBJC_PR_weak && + !getLangOptions().ObjCAutoRefCount && + getLangOptions().getGCMode() != + LangOptions::NonGC); + if (PropertyIsGCWeak) + PropType = Context.getObjCGCQualType(PropType, Qualifiers::Weak); QualType PropertyIvarType = PropType; if (PropType->isReferenceType()) PropertyIvarType = cast<ReferenceType>(PropType)->getPointeeType(); |