diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-17 23:35:13 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-17 23:35:13 +0000 |
commit | 96c7d0173a9110c73f63c2c121017cceff2fffc0 (patch) | |
tree | 9dd4f8f53ca3eb1e392ccdda73bb122bbdaa66f8 /lib/Sema/ScopeInfo.cpp | |
parent | 9bef4617c65567453527b199f29b535e56677206 (diff) | |
download | clang-96c7d0173a9110c73f63c2c121017cceff2fffc0.tar.gz |
Objective-C ARC. Do not warn about properties with both
IBOutlet and weak attributes when accessed being
unpredictably set to nil because usage of such properties
are always single threaded and its ivar cannot be set
to nil asynchronously. // rdar://15885642
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/ScopeInfo.cpp')
-rw-r--r-- | lib/Sema/ScopeInfo.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Sema/ScopeInfo.cpp b/lib/Sema/ScopeInfo.cpp index d9b2ca310a..4d079e705f 100644 --- a/lib/Sema/ScopeInfo.cpp +++ b/lib/Sema/ScopeInfo.cpp @@ -158,8 +158,14 @@ void FunctionScopeInfo::markSafeWeakUse(const Expr *E) { // Has this weak object been seen before? FunctionScopeInfo::WeakObjectUseMap::iterator Uses; - if (const ObjCPropertyRefExpr *RefExpr = dyn_cast<ObjCPropertyRefExpr>(E)) - Uses = WeakObjectUses.find(WeakObjectProfileTy(RefExpr)); + if (const ObjCPropertyRefExpr *RefExpr = dyn_cast<ObjCPropertyRefExpr>(E)) { + if (isa<OpaqueValueExpr>(RefExpr->getBase())) + Uses = WeakObjectUses.find(WeakObjectProfileTy(RefExpr)); + else { + markSafeWeakUse(RefExpr->getBase()); + return; + } + } else if (const ObjCIvarRefExpr *IvarE = dyn_cast<ObjCIvarRefExpr>(E)) Uses = WeakObjectUses.find(WeakObjectProfileTy(IvarE)); else if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) |