Gabor Horvath | 829e75a | 2017-07-14 12:15:55 +0000 | [diff] [blame^] | 1 | //===--- BugproneTidyModule.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 "SuspiciousMemsetUsageCheck.h" |
| 14 | |
| 15 | namespace clang { |
| 16 | namespace tidy { |
| 17 | namespace bugprone { |
| 18 | |
| 19 | class BugproneModule : public ClangTidyModule { |
| 20 | public: |
| 21 | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { |
| 22 | CheckFactories.registerCheck<SuspiciousMemsetUsageCheck>( |
| 23 | "bugprone-suspicious-memset-usage"); |
| 24 | } |
| 25 | }; |
| 26 | |
| 27 | } // namespace bugprone |
| 28 | |
| 29 | // Register the BugproneTidyModule using this statically initialized variable. |
| 30 | static ClangTidyModuleRegistry::Add<bugprone::BugproneModule> |
| 31 | X("bugprone-module", "Adds checks for bugprone code constructs."); |
| 32 | |
| 33 | // This anchor is used to force the linker to link in the generated object file |
| 34 | // and thus register the BugproneModule. |
| 35 | volatile int BugproneModuleAnchorSource = 0; |
| 36 | |
| 37 | } // namespace tidy |
| 38 | } // namespace clang |