Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 1 | //===--- LLVMTidyModule.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 | bef51cd | 2014-05-19 16:39:08 +0000 | [diff] [blame] | 13 | #include "IncludeOrderCheck.h" |
| 14 | #include "NamespaceCommentCheck.h" |
Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 15 | |
| 16 | namespace clang { |
| 17 | namespace tidy { |
| 18 | |
Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 19 | class LLVMModule : public ClangTidyModule { |
| 20 | public: |
Alexander Kornienko | 21f3b77 | 2014-03-05 13:01:24 +0000 | [diff] [blame] | 21 | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { |
Daniel Jasper | d07c840 | 2013-07-29 08:19:24 +0000 | [diff] [blame] | 22 | CheckFactories.addCheckFactory( |
| 23 | "llvm-include-order", new ClangTidyCheckFactory<IncludeOrderCheck>()); |
| 24 | CheckFactories.addCheckFactory( |
| 25 | "llvm-namespace-comment", |
| 26 | new ClangTidyCheckFactory<NamespaceCommentCheck>()); |
| 27 | } |
| 28 | }; |
| 29 | |
| 30 | // Register the LLVMTidyModule using this statically initialized variable. |
| 31 | static ClangTidyModuleRegistry::Add<LLVMModule> X("llvm-module", |
| 32 | "Adds LLVM lint checks."); |
| 33 | |
| 34 | // This anchor is used to force the linker to link in the generated object file |
| 35 | // and thus register the LLVMModule. |
| 36 | volatile int LLVMModuleAnchorSource = 0; |
| 37 | |
| 38 | } // namespace tidy |
| 39 | } // namespace clang |