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 | 9277ff426d39053dfc7c02aa441d9c99607fed13 (patch) | |
tree | 01c2ed23e552f19753dd7c5f264deb7782623162 /clang/lib/Sema/SemaExprObjC.cpp | |
parent | f6e456dd638741a180032de960b4fc60d31480a4 (diff) | |
download | bcm5719-llvm-9277ff426d39053dfc7c02aa441d9c99607fed13.tar.gz bcm5719-llvm-9277ff426d39053dfc7c02aa441d9c99607fed13.zip |
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
llvm-svn: 211132
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index ffb6b037ec0..c6a7d7c13dc 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -2640,7 +2640,14 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, } if (getLangOpts().ObjCAutoRefCount) { - DiagnoseARCUseOfWeakReceiver(*this, Receiver); + // Do not warn about IBOutlet weak property receivers being set to null + // as this cannot asynchronously happen. + bool WarnWeakReceiver = true; + if (isImplicit && Method) + if (const ObjCPropertyDecl *PropertyDecl = Method->findPropertyDecl()) + WarnWeakReceiver = !PropertyDecl->hasAttr<IBOutletAttr>(); + if (WarnWeakReceiver) + DiagnoseARCUseOfWeakReceiver(*this, Receiver); // In ARC, annotate delegate init calls. if (Result->getMethodFamily() == OMF_init && |