diff options
author | Kristof Umann <dkszelethus@gmail.com> | 2019-01-26 14:23:08 +0000 |
---|---|---|
committer | Kristof Umann <dkszelethus@gmail.com> | 2019-01-26 14:23:08 +0000 |
commit | 058a7a450aac183d28451191333b3eb33814f62a (patch) | |
tree | 07c0f89710aea1f833e3b0dd15cabc0f79e93b32 /clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp | |
parent | db07683d866bdd0c1d2b651066081b64f9563333 (diff) | |
download | bcm5719-llvm-058a7a450aac183d28451191333b3eb33814f62a.tar.gz bcm5719-llvm-058a7a450aac183d28451191333b3eb33814f62a.zip |
[analyzer] Supply all checkers with a shouldRegister function
Introduce the boolean ento::shouldRegister##CHECKERNAME(const LangOptions &LO)
function very similarly to ento::register##CHECKERNAME. This will force every
checker to implement this function, but maybe it isn't that bad: I saw a lot of
ObjC or C++ specific checkers that should probably not register themselves based
on some LangOptions (mine too), but they do anyways.
A big benefit of this is that all registry functions now register their checker,
once it is called, registration is guaranteed.
This patch is a part of a greater effort to reinvent checker registration, more
info here: D54438#1315953
Differential Revision: https://reviews.llvm.org/D55424
llvm-svn: 352277
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp index 21b61005822..e744ff9d7c9 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RunLoopAutoreleaseLeakChecker.cpp @@ -202,3 +202,7 @@ void RunLoopAutoreleaseLeakChecker::checkASTCodeBody(const Decl *D, void ento::registerRunLoopAutoreleaseLeakChecker(CheckerManager &mgr) { mgr.registerChecker<RunLoopAutoreleaseLeakChecker>(); } + +bool ento::shouldRegisterRunLoopAutoreleaseLeakChecker(const LangOptions &LO) { + return true; +} |