blob: 32097eb62497c5cec2b2a13f0f897ef0b9740f5b [file] [log] [blame]
Alexander Kornienkob959f4c2015-12-30 10:24:40 +00001//===--- 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 Kornienko5aebfe22016-01-29 15:54:26 +000014#include "ForRangeCopyCheck.h"
Alexander Kornienko40d307d2016-01-29 15:21:32 +000015#include "ImplicitCastInLoopCheck.h"
Alexander Kornienkob959f4c2015-12-30 10:24:40 +000016#include "UnnecessaryCopyInitialization.h"
17
18namespace clang {
19namespace tidy {
20namespace performance {
21
22class PerformanceModule : public ClangTidyModule {
23public:
24 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
Alexander Kornienko5aebfe22016-01-29 15:54:26 +000025 CheckFactories.registerCheck<ForRangeCopyCheck>(
26 "performance-for-range-copy");
Alexander Kornienko40d307d2016-01-29 15:21:32 +000027 CheckFactories.registerCheck<ImplicitCastInLoopCheck>(
28 "performance-implicit-cast-in-loop");
Alexander Kornienkob959f4c2015-12-30 10:24:40 +000029 CheckFactories.registerCheck<UnnecessaryCopyInitialization>(
30 "performance-unnecessary-copy-initialization");
31 }
32};
33
34// Register the PerformanceModule using this statically initialized variable.
35static ClangTidyModuleRegistry::Add<PerformanceModule>
36 X("performance-module", "Adds performance checks.");
37
38} // namespace performance
39
40// This anchor is used to force the linker to link in the generated object file
41// and thus register the PerformanceModule.
42volatile int PerformanceModuleAnchorSource = 0;
43
44} // namespace tidy
45} // namespace clang