blob: 977e6a86b6469e1a1a1a7e120345f0f88d4cdec8 [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 Kornienko40d307d2016-01-29 15:21:32 +000014#include "ImplicitCastInLoopCheck.h"
Alexander Kornienkob959f4c2015-12-30 10:24:40 +000015#include "UnnecessaryCopyInitialization.h"
16
17namespace clang {
18namespace tidy {
19namespace performance {
20
21class PerformanceModule : public ClangTidyModule {
22public:
23 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
Alexander Kornienko40d307d2016-01-29 15:21:32 +000024 CheckFactories.registerCheck<ImplicitCastInLoopCheck>(
25 "performance-implicit-cast-in-loop");
Alexander Kornienkob959f4c2015-12-30 10:24:40 +000026 CheckFactories.registerCheck<UnnecessaryCopyInitialization>(
27 "performance-unnecessary-copy-initialization");
28 }
29};
30
31// Register the PerformanceModule using this statically initialized variable.
32static 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.
39volatile int PerformanceModuleAnchorSource = 0;
40
41} // namespace tidy
42} // namespace clang