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 | af45aca670d8605c459e23699da9441c57e0b680 (patch) | |
tree | 40deddf70c9ffa32ec1f634195dc333351a2a5b3 /clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp | |
parent | 24ffc08f394259ab926f2b7c4807e360ef04c51d (diff) | |
download | bcm5719-llvm-af45aca670d8605c459e23699da9441c57e0b680.tar.gz bcm5719-llvm-af45aca670d8605c459e23699da9441c57e0b680.zip |
[analyzer] Use the new registration mechanism on the non-path-sensitive-checkers:
DeadStoresChecker
ObjCMethSigsChecker
ObjCUnusedIvarsChecker
SizeofPointerChecker
ObjCDeallocChecker
SecuritySyntaxChecker
llvm-svn: 125779
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp index dc8e127a5a7..6e92498769f 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp +++ b/clang/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>(); +} |