aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
diff options
context:
space:
mode:
authorMichael Wyman <michael@mwyman.com>2020-04-05 00:28:34 -0700
committerMichael Wyman <michael@mwyman.com>2020-04-10 08:51:21 -0700
commit89f1321fe4ef203a4674213280b430a274dc2001 (patch)
treeae506c8975d8bf93c05602674e75af4b8cbfe6ef /clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
parent65b8b643b4ba75a2712ddc210aeaa7c6527f3bb4 (diff)
downloadllvm-89f1321fe4ef203a4674213280b430a274dc2001.zip
llvm-89f1321fe4ef203a4674213280b430a274dc2001.tar.gz
llvm-89f1321fe4ef203a4674213280b430a274dc2001.tar.bz2
[clang-tidy] Add check to find calls to NSInvocation methods under ARC that don't have proper object argument lifetimes.
Summary: This check is similar to an ARC Migration check that warned about this incorrect usage under ARC, but most projects are no longer undergoing migration from pre-ARC code. The documentation for NSInvocation is not explicit about these requirements and incorrect usage has been found in many of our projects. Reviewers: stephanemoore, benhamilton, dmaclach, alexfh, aaron.ballman, hokein, njames93 Reviewed By: stephanemoore, benhamilton, aaron.ballman Subscribers: xazax.hun, Eugene.Zelenko, mgorny, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D77571
Diffstat (limited to 'clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp b/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
index ff220b8..56ab0ab 100644
--- a/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/objc/ObjCTidyModule.cpp
@@ -13,6 +13,7 @@
#include "DeallocInCategoryCheck.h"
#include "ForbiddenSubclassingCheck.h"
#include "MissingHashCheck.h"
+#include "NSInvocationArgumentLifetimeCheck.h"
#include "PropertyDeclarationCheck.h"
#include "SuperSelfCheck.h"
@@ -33,6 +34,8 @@ public:
"objc-forbidden-subclassing");
CheckFactories.registerCheck<MissingHashCheck>(
"objc-missing-hash");
+ CheckFactories.registerCheck<NSInvocationArgumentLifetimeCheck>(
+ "objc-nsinvocation-argument-lifetime");
CheckFactories.registerCheck<PropertyDeclarationCheck>(
"objc-property-declaration");
CheckFactories.registerCheck<SuperSelfCheck>(