diff options
author | Samuel Benzaquen <sbenza@google.com> | 2014-10-23 17:23:20 +0000 |
---|---|---|
committer | Samuel Benzaquen <sbenza@google.com> | 2014-10-23 17:23:20 +0000 |
commit | 07babf8b5c80f56ababdb1959cc54e6cc22f903b (patch) | |
tree | c73f80214fbb0966a19fc60a44e585cf2bef168e /clang-tidy/ClangTidy.h | |
parent | 41094c7cc6512fd687f64312c2d95b6a33fc22fc (diff) |
Add flag --enable-check-profile to clang-tidy.
Summary:
Add flag --enable-check-profile to clang-tidy.
It turns on per-matcher profiles in MatchFinder and prints a report to
stderr at the end.
Reviewers: alexfh
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D5937
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@220491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/ClangTidy.h')
-rw-r--r-- | clang-tidy/ClangTidy.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/clang-tidy/ClangTidy.h b/clang-tidy/ClangTidy.h index 0892298c..4038d030 100644 --- a/clang-tidy/ClangTidy.h +++ b/clang-tidy/ClangTidy.h @@ -152,6 +152,7 @@ public: private: void run(const ast_matchers::MatchFinder::MatchResult &Result) override; + StringRef getID() const override { return CheckName; } std::string CheckName; ClangTidyContext *Context; @@ -196,11 +197,15 @@ std::vector<std::string> getCheckNames(const ClangTidyOptions &Options); ClangTidyOptions::OptionMap getCheckOptions(const ClangTidyOptions &Options); /// \brief Run a set of clang-tidy checks on a set of files. +/// +/// \param Profile if provided, it enables check profile collection in +/// MatchFinder, and will contain the result of the profile. ClangTidyStats runClangTidy(std::unique_ptr<ClangTidyOptionsProvider> OptionsProvider, const tooling::CompilationDatabase &Compilations, ArrayRef<std::string> InputFiles, - std::vector<ClangTidyError> *Errors); + std::vector<ClangTidyError> *Errors, + ProfileData *Profile = nullptr); // FIXME: This interface will need to be significantly extended to be useful. // FIXME: Implement confidence levels for displaying/fixing errors. |