diff options
author | Alexander Kornienko <alexfh@google.com> | 2013-12-19 19:57:05 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2013-12-19 19:57:05 +0000 |
commit | f0c740b38285ace936401dc735e7e4e511aad8aa (patch) | |
tree | 95c7bee795af8d78ef02a2a2944feb3f06c20408 /clang-tidy/ClangTidyModule.h | |
parent | 6d817272e2e36ec76588f6089fe5d096a82cfb97 (diff) |
Clang-tidy: added --disable-checks, --list-checks options.
Summary:
Allow disabling checks by regex. By default, disable alpha.* checks,
that are not particularly good tested (e.g. IdempotentOperationChecker, see
http://llvm-reviews.chandlerc.com/D2427).
Fixed a bug, that would disable all analyzer checks, when using a regex more
strict, than 'clang-analyzer-', for example --checks='clang-analyzer-deadcode-'.
Added --list-checks to list all enabled checks. This is useful to test specific
values in --checks/--disable-checks.
Reviewers: djasper, klimek
Reviewed By: klimek
CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2444
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@197717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/ClangTidyModule.h')
-rw-r--r-- | clang-tidy/ClangTidyModule.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang-tidy/ClangTidyModule.h b/clang-tidy/ClangTidyModule.h index 7008863b..830cbd5b 100644 --- a/clang-tidy/ClangTidyModule.h +++ b/clang-tidy/ClangTidyModule.h @@ -26,7 +26,7 @@ namespace tidy { /// this subclass in \c ClangTidyModule::addCheckFactories(). class CheckFactoryBase { public: - virtual ~CheckFactoryBase(); + virtual ~CheckFactoryBase() {} virtual ClangTidyCheck *createCheck() = 0; }; @@ -84,12 +84,15 @@ public: /// store them in \p Checks. /// /// The caller takes ownership of the return \c ClangTidyChecks. - void createChecks(StringRef CheckRegexString, + void createChecks(ChecksFilter &Filter, SmallVectorImpl<ClangTidyCheck *> &Checks); + typedef std::map<std::string, CheckFactoryBase *> FactoryMap; + FactoryMap::const_iterator begin() const { return Factories.begin(); } + FactoryMap::const_iterator end() const { return Factories.end(); } + private: - StringRef FilterRegex; - std::map<std::string, CheckFactoryBase *> Factories; + FactoryMap Factories; }; } // end namespace tidy |