Alexander Kornienko | b959f4c | 2015-12-30 10:24:40 +0000 | [diff] [blame] | 1 | //===--- PeformanceTidyModule.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 | |
Alexander Kornienko | 40d307d | 2016-01-29 15:21:32 +0000 | [diff] [blame] | 14 | #include "ImplicitCastInLoopCheck.h" |
Alexander Kornienko | b959f4c | 2015-12-30 10:24:40 +0000 | [diff] [blame] | 15 | #include "UnnecessaryCopyInitialization.h" |
| 16 | |
| 17 | namespace clang { |
| 18 | namespace tidy { |
| 19 | namespace performance { |
| 20 | |
| 21 | class PerformanceModule : public ClangTidyModule { |
| 22 | public: |
| 23 | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { |
Alexander Kornienko | 40d307d | 2016-01-29 15:21:32 +0000 | [diff] [blame] | 24 | CheckFactories.registerCheck<ImplicitCastInLoopCheck>( |
| 25 | "performance-implicit-cast-in-loop"); |
Alexander Kornienko | b959f4c | 2015-12-30 10:24:40 +0000 | [diff] [blame] | 26 | CheckFactories.registerCheck<UnnecessaryCopyInitialization>( |
| 27 | "performance-unnecessary-copy-initialization"); |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | // Register the PerformanceModule using this statically initialized variable. |
| 32 | static ClangTidyModuleRegistry::Add<PerformanceModule> |
| 33 | X("performance-module", "Adds performance checks."); |
| 34 | |
| 35 | } // namespace performance |
| 36 | |
| 37 | // This anchor is used to force the linker to link in the generated object file |
| 38 | // and thus register the PerformanceModule. |
| 39 | volatile int PerformanceModuleAnchorSource = 0; |
| 40 | |
| 41 | } // namespace tidy |
| 42 | } // namespace clang |