clang-tools 3.8.0

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

PerformanceTidyModule.cpp
Go to the documentation of this file.
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
14 #include "UnnecessaryCopyInitialization.h"
15
16 namespace clang {
17 namespace tidy {
18 namespace performance {
19
20 class PerformanceModule : public ClangTidyModule {
21 public:
22 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
23 CheckFactories.registerCheck<UnnecessaryCopyInitialization>(
24 "performance-unnecessary-copy-initialization");
25 }
26 };
27
28 // Register the PerformanceModule using this statically initialized variable.
29 static ClangTidyModuleRegistry::Add<PerformanceModule>
30 X("performance-module", "Adds performance checks.");
31
32 } // namespace performance
33
34 // This anchor is used to force the linker to link in the generated object file
35 // and thus register the PerformanceModule.
36 volatile int PerformanceModuleAnchorSource = 0;
37
38 } // namespace tidy
39 } // namespace clang
clang::tidy::performance::UnnecessaryCopyInitialization
Definition: UnnecessaryCopyInitialization.h:27
clang::tidy::ClangTidyCheckFactories::registerCheck
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
Definition: ClangTidyModule.h:58
clang::tidy::ClangTidyCheckFactories
A collection of ClangTidyCheckFactory instances.
Definition: ClangTidyModule.h:27
clang::tidy::PerformanceModuleAnchorSource
volatile int PerformanceModuleAnchorSource
Definition: PerformanceTidyModule.cpp:36
clang::tidy::ClangTidyModule
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Definition: ClangTidyModule.h:83
clang::tidy::performance::PerformanceModule::addCheckFactories
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
Definition: PerformanceTidyModule.cpp:22
clang::tidy::performance::PerformanceModule
Definition: PerformanceTidyModule.cpp:20
clang::tidy::performance::X
static ClangTidyModuleRegistry::Add< PerformanceModule > X("performance-module","Adds performance checks.")
UnnecessaryCopyInitialization.h