diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-17 21:39:33 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-17 21:39:33 +0000 |
commit | 7dd445ec20e704846cfbdb132e56539280d71311 (patch) | |
tree | ba32d283b3e96e358891fc14519365cf057ea1fe /lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp | |
parent | 9fb9474c5b267400d4abfbff63c8b39f378235d4 (diff) |
[analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:
DeadStoresChecker
ObjCMethSigsChecker
ObjCUnusedIvarsChecker
SizeofPointerChecker
ObjCDeallocChecker
SecuritySyntaxChecker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp index dc8e127a5a..6e92498769 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp @@ -13,7 +13,8 @@ // //===----------------------------------------------------------------------===// -#include "clang/StaticAnalyzer/Checkers/LocalCheckers.h" +#include "ClangSACheckers.h" +#include "clang/StaticAnalyzer/Core/CheckerV2.h" #include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h" #include "clang/AST/ExprObjC.h" @@ -98,7 +99,7 @@ static void Scan(IvarUsageMap &M, const DeclContext *C, const FileID FID, } } -void ento::CheckObjCUnusedIvar(const ObjCImplementationDecl *D, +static void checkObjCUnusedIvar(const ObjCImplementationDecl *D, BugReporter &BR) { const ObjCInterfaceDecl* ID = D->getClassInterface(); @@ -162,3 +163,22 @@ void ento::CheckObjCUnusedIvar(const ObjCImplementationDecl *D, os.str(), I->first->getLocation()); } } + +//===----------------------------------------------------------------------===// +// ObjCUnusedIvarsChecker +//===----------------------------------------------------------------------===// + +namespace { +class ObjCUnusedIvarsChecker : public CheckerV2< + check::ASTDecl<ObjCImplementationDecl> > { +public: + void checkASTDecl(const ObjCImplementationDecl *D, AnalysisManager& mgr, + BugReporter &BR) const { + checkObjCUnusedIvar(D, BR); + } +}; +} + +void ento::registerObjCUnusedIvarsChecker(CheckerManager &mgr) { + mgr.registerChecker<ObjCUnusedIvarsChecker>(); +} |