clang-tools 6.0.0

BoostTidyModule.cpp
Go to the documentation of this file.
1 //===------- BoostTidyModule.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 #include "UseToStringCheck.h"
14 using namespace clang::ast_matchers;
15
16 namespace clang {
17 namespace tidy {
18 namespace boost {
19
20 class BoostModule : public ClangTidyModule {
21 public:
22 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
23 CheckFactories.registerCheck<UseToStringCheck>("boost-use-to-string");
24 }
25 };
26
27 // Register the BoostModule using this statically initialized variable.
28 static ClangTidyModuleRegistry::Add<BoostModule> X("boost-module",
29 "Add boost checks.");
30
31 } // namespace boost
32
33 // This anchor is used to force the linker to link in the generated object file
34 // and thus register the BoostModule.
35 volatile int BoostModuleAnchorSource = 0;
36
37 } // namespace tidy
38 } // namespace clang
clang::ast_matchers
Definition: ClangTidyDiagnosticConsumer.h:27
UseToStringCheck.h
clang::tidy::boost::BoostModule::addCheckFactories
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
Definition: BoostTidyModule.cpp:22
clang::tidy::boost::BoostModule
Definition: BoostTidyModule.cpp:20
clang::tidy::ClangTidyCheckFactories::registerCheck
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
Definition: ClangTidyModule.h:59
clang::tidy::ClangTidyCheckFactories
A collection of ClangTidyCheckFactory instances.
Definition: ClangTidyModule.h:27
clang::tidy::ClangTidyModule
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Definition: ClangTidyModule.h:84
clang::tidy::BoostModuleAnchorSource
volatile int BoostModuleAnchorSource
Definition: BoostTidyModule.cpp:35
X
static clang::FrontendPluginRegistry::Add< clang::tidy::ClangTidyPluginAction > X("clang-tidy", "clang-tidy")
clang
Definition: AndroidTidyModule.cpp:28
clang::tidy::boost::UseToStringCheck
Finds calls to boost::lexical_cast<std::string> and boost::lexical_cast<std::wstring> and replaces th...
Definition: UseToStringCheck.h:25