diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-12-01 00:59:21 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-12-01 00:59:21 +0000 |
commit | 968a0ee9d98549308e3e70e787e4fd669d2a829d (patch) | |
tree | 2c41e20ee236c114c321ae8f47aab4988456fa7a /lib/Sema/SemaChecking.cpp | |
parent | 75df4eeede7b91c22c1d63fafd4dd4142844e3b9 (diff) |
Specially whitelist the selector 'addOperationWithBlock:' for the retain-cycle checking in -Warc-retain-cycles. This commonly
is hit by users using NSOperationQueue. Fixes <rdar://problem/10465721>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145548 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index ec36963ed6..0d640a8c12 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -4533,8 +4533,14 @@ static bool isSetterLikeSelector(Selector sel) { StringRef str = sel.getNameForSlot(0); while (!str.empty() && str.front() == '_') str = str.substr(1); - if (str.startswith("set") || str.startswith("add")) + if (str.startswith("set")) str = str.substr(3); + else if (str.startswith("add")) { + // Specially whitelist 'addOperationWithBlock:'. + if (sel.getNumArgs() == 1 && str.startswith("addOperationWithBlock")) + return false; + str = str.substr(3); + } else return false; |