Piotr Padlewski | 5625f65 | 2016-04-29 17:58:29 +0000 | [diff] [blame] | 1 | //===------- BoostTidyModule.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 | |
| 10 | #include "../ClangTidy.h" |
| 11 | #include "../ClangTidyModule.h" |
| 12 | #include "../ClangTidyModuleRegistry.h" |
| 13 | #include "UseToStringCheck.h" |
| 14 | using namespace clang::ast_matchers; |
| 15 | |
| 16 | namespace clang { |
| 17 | namespace tidy { |
| 18 | namespace boost { |
| 19 | |
| 20 | class BoostModule : public ClangTidyModule { |
| 21 | public: |
| 22 | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { |
| 23 | CheckFactories.registerCheck<UseToStringCheck>("boost-use-to-string"); |
| 24 | } |
| 25 | }; |
| 26 | |
| 27 | // Register the BoostModule using this statically initialized variable. |
| 28 | static ClangTidyModuleRegistry::Add<BoostModule> X("boost-module", |
| 29 | "Add boost checks."); |
| 30 | |
| 31 | } // namespace boost |
| 32 | |
| 33 | // This anchor is used to force the linker to link in the generated object file |
| 34 | // and thus register the BoostModule. |
| 35 | volatile int BoostModuleAnchorSource = 0; |
| 36 | |
| 37 | } // namespace tidy |
| 38 | } // namespace clang |