clang-tools 6.0.0

FuchsiaTidyModule.cpp
Go to the documentation of this file.
1 //===--- FuchsiaTidyModule.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 "DefaultArgumentsCheck.h"
14 #include "OverloadedOperatorCheck.h"
15 #include "VirtualInheritanceCheck.h"
16
17 using namespace clang::ast_matchers;
18
19 namespace clang {
20 namespace tidy {
21 namespace fuchsia {
22
23 /// This module is for Fuchsia-specific checks.
24 class FuchsiaModule : public ClangTidyModule {
25 public:
26 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
27 CheckFactories.registerCheck<DefaultArgumentsCheck>(
28 "fuchsia-default-arguments");
29 CheckFactories.registerCheck<OverloadedOperatorCheck>(
30 "fuchsia-overloaded-operator");
31 CheckFactories.registerCheck<VirtualInheritanceCheck>(
32 "fuchsia-virtual-inheritance");
33 }
34 };
35 // Register the FuchsiaTidyModule using this statically initialized variable.
36 static ClangTidyModuleRegistry::Add<FuchsiaModule>
37 X("fuchsia-module", "Adds Fuchsia platform checks.");
38 } // namespace fuchsia
39
40 // This anchor is used to force the linker to link in the generated object file
41 // and thus register the FuchsiaModule.
42 volatile int FuchsiaModuleAnchorSource = 0;
43
44 } // namespace tidy
45 } // namespace clang
clang::ast_matchers
Definition: ClangTidyDiagnosticConsumer.h:27
OverloadedOperatorCheck.h
VirtualInheritanceCheck.h
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::fuchsia::VirtualInheritanceCheck
Defining classes with virtual inheritance is disallowed.
Definition: VirtualInheritanceCheck.h:23
clang::tidy::ClangTidyModule
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Definition: ClangTidyModule.h:84
DefaultArgumentsCheck.h
clang::tidy::fuchsia::FuchsiaModule::addCheckFactories
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
Definition: FuchsiaTidyModule.cpp:26
clang::tidy::fuchsia::DefaultArgumentsCheck
Default arguments are not allowed in declared or called functions.
Definition: fuchsia/DefaultArgumentsCheck.h:23
X
static clang::FrontendPluginRegistry::Add< clang::tidy::ClangTidyPluginAction > X("clang-tidy", "clang-tidy")
clang
Definition: AndroidTidyModule.cpp:28
clang::tidy::fuchsia::OverloadedOperatorCheck
Overloading operators is disallowed by the Fuchsia coding standard.
Definition: OverloadedOperatorCheck.h:23
clang::tidy::fuchsia::FuchsiaModule
This module is for Fuchsia-specific checks.
Definition: FuchsiaTidyModule.cpp:24
clang::tidy::FuchsiaModuleAnchorSource
volatile int FuchsiaModuleAnchorSource
Definition: FuchsiaTidyModule.cpp:42