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 | fb9e92b1670c2e6fd2d1588ea982c618e559d8aa (patch) | |
tree | 4d1b934f540b717eaf17ee65b1e593d776fd3585 /clang-tools-extra/clang-tidy/ClangTidyModule.h | |
parent | aa47d24a471538e2f8b40991a6515ace544ad931 (diff) | |
download | bcm5719-llvm-fb9e92b1670c2e6fd2d1588ea982c618e559d8aa.tar.gz bcm5719-llvm-fb9e92b1670c2e6fd2d1588ea982c618e559d8aa.zip |
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
llvm-svn: 197717
Diffstat (limited to 'clang-tools-extra/clang-tidy/ClangTidyModule.h')
-rw-r--r-- | clang-tools-extra/clang-tidy/ClangTidyModule.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidyModule.h b/clang-tools-extra/clang-tidy/ClangTidyModule.h index 7008863b31a..830cbd5b15c 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyModule.h +++ b/clang-tools-extra/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 |