Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 1 | //===--- GoogleTidyModule.cpp - clang-tidy --------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 10 | #include "../ClangTidy.h" |
| 11 | #include "../ClangTidyModule.h" |
| 12 | #include "../ClangTidyModuleRegistry.h" |
Alexander Kornienko | 72f1e75 | 2014-06-18 09:33:46 +0000 | [diff] [blame^] | 13 | #include "ExplicitConstructorCheck.h" |
Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 14 | |
| 15 | using namespace clang::ast_matchers; |
| 16 | |
| 17 | namespace clang { |
| 18 | namespace tidy { |
| 19 | |
Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 20 | class GoogleModule : public ClangTidyModule { |
| 21 | public: |
Alexander Kornienko | 21f3b77 | 2014-03-05 13:01:24 +0000 | [diff] [blame] | 22 | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { |
Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 23 | CheckFactories.addCheckFactory( |
| 24 | "google-explicit-constructor", |
| 25 | new ClangTidyCheckFactory<ExplicitConstructorCheck>()); |
| 26 | } |
| 27 | }; |
| 28 | |
| 29 | // Register the GoogleTidyModule using this statically initialized variable. |
| 30 | static ClangTidyModuleRegistry::Add<GoogleModule> X("google-module", |
| 31 | "Adds Google lint checks."); |
| 32 | |
| 33 | // This anchor is used to force the linker to link in the generated object file |
| 34 | // and thus register the GoogleModule. |
| 35 | volatile int GoogleModuleAnchorSource = 0; |
| 36 | |
| 37 | } // namespace tidy |
| 38 | } // namespace clang |