diff options
| author | Alexander Kornienko <alexfh@google.com> | 2014-04-29 15:20:10 +0000 |
|---|---|---|
| committer | Alexander Kornienko <alexfh@google.com> | 2014-04-29 15:20:10 +0000 |
| commit | 33a9bcce29845228c73c6cd1d3ee608e9c0b9f87 (patch) | |
| tree | 82dca4588e467a602b8b76454fc3c89f347bd72e /clang-tools-extra/clang-tidy/ClangTidy.cpp | |
| parent | 014225e11e24c140a991675b0f20b6bf8992cdd5 (diff) | |
| download | bcm5719-llvm-33a9bcce29845228c73c6cd1d3ee608e9c0b9f87.tar.gz bcm5719-llvm-33a9bcce29845228c73c6cd1d3ee608e9c0b9f87.zip | |
Add ClangTidyOptions to encapsulate all clang-tidy options.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D3544
llvm-svn: 207532
Diffstat (limited to 'clang-tools-extra/clang-tidy/ClangTidy.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/ClangTidy.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp index 84a208ed12d..c9395497bcb 100644 --- a/clang-tools-extra/clang-tidy/ClangTidy.cpp +++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp @@ -285,24 +285,21 @@ void ClangTidyCheck::setName(StringRef Name) { CheckName = Name.str(); } -std::vector<std::string> getCheckNames(StringRef EnableChecksRegex, - StringRef DisableChecksRegex) { +std::vector<std::string> getCheckNames(const ClangTidyOptions &Options) { SmallVector<ClangTidyError, 8> Errors; - clang::tidy::ClangTidyContext Context(&Errors, EnableChecksRegex, - DisableChecksRegex); + clang::tidy::ClangTidyContext Context(&Errors, Options); ClangTidyASTConsumerFactory Factory(Context); return Factory.getCheckNames(); } -void runClangTidy(StringRef EnableChecksRegex, StringRef DisableChecksRegex, +void runClangTidy(const ClangTidyOptions &Options, const tooling::CompilationDatabase &Compilations, ArrayRef<std::string> Ranges, SmallVectorImpl<ClangTidyError> *Errors) { // FIXME: Ranges are currently full files. Support selecting specific // (line-)ranges. ClangTool Tool(Compilations, Ranges); - clang::tidy::ClangTidyContext Context(Errors, EnableChecksRegex, - DisableChecksRegex); + clang::tidy::ClangTidyContext Context(Errors, Options); ClangTidyDiagnosticConsumer DiagConsumer(Context); Tool.setDiagnosticConsumer(&DiagConsumer); |

