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 | |
Samuel Benzaquen | 51e1523 | 2016-02-12 19:28:14 +0000 | [diff] [blame] | 14 | #include "FasterStringFindCheck.h" |
Alexander Kornienko | 5aebfe2 | 2016-01-29 15:54:26 +0000 | [diff] [blame] | 15 | #include "ForRangeCopyCheck.h" |
Alexander Kornienko | 40d307d | 2016-01-29 15:21:32 +0000 | [diff] [blame] | 16 | #include "ImplicitCastInLoopCheck.h" |
Alexander Kornienko | b959f4c | 2015-12-30 10:24:40 +0000 | [diff] [blame] | 17 | #include "UnnecessaryCopyInitialization.h" |
Felix Berger | 3c8edde | 2016-03-29 02:42:38 +0000 | [diff] [blame^] | 18 | #include "UnnecessaryValueParamCheck.h" |
Alexander Kornienko | b959f4c | 2015-12-30 10:24:40 +0000 | [diff] [blame] | 19 | |
| 20 | namespace clang { |
| 21 | namespace tidy { |
| 22 | namespace performance { |
| 23 | |
| 24 | class PerformanceModule : public ClangTidyModule { |
| 25 | public: |
| 26 | void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { |
Samuel Benzaquen | 51e1523 | 2016-02-12 19:28:14 +0000 | [diff] [blame] | 27 | CheckFactories.registerCheck<FasterStringFindCheck>( |
| 28 | "performance-faster-string-find"); |
Alexander Kornienko | 5aebfe2 | 2016-01-29 15:54:26 +0000 | [diff] [blame] | 29 | CheckFactories.registerCheck<ForRangeCopyCheck>( |
| 30 | "performance-for-range-copy"); |
Alexander Kornienko | 40d307d | 2016-01-29 15:21:32 +0000 | [diff] [blame] | 31 | CheckFactories.registerCheck<ImplicitCastInLoopCheck>( |
| 32 | "performance-implicit-cast-in-loop"); |
Alexander Kornienko | b959f4c | 2015-12-30 10:24:40 +0000 | [diff] [blame] | 33 | CheckFactories.registerCheck<UnnecessaryCopyInitialization>( |
| 34 | "performance-unnecessary-copy-initialization"); |
Felix Berger | 3c8edde | 2016-03-29 02:42:38 +0000 | [diff] [blame^] | 35 | CheckFactories.registerCheck<UnnecessaryValueParamCheck>( |
| 36 | "performance-unnecessary-value-param"); |
Alexander Kornienko | b959f4c | 2015-12-30 10:24:40 +0000 | [diff] [blame] | 37 | } |
| 38 | }; |
| 39 | |
| 40 | // Register the PerformanceModule using this statically initialized variable. |
| 41 | static ClangTidyModuleRegistry::Add<PerformanceModule> |
| 42 | X("performance-module", "Adds performance checks."); |
| 43 | |
| 44 | } // namespace performance |
| 45 | |
| 46 | // This anchor is used to force the linker to link in the generated object file |
| 47 | // and thus register the PerformanceModule. |
| 48 | volatile int PerformanceModuleAnchorSource = 0; |
| 49 | |
| 50 | } // namespace tidy |
| 51 | } // namespace clang |