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"
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.
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
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
A collection of ClangTidyCheckFactory instances.
Defining classes with virtual inheritance is disallowed.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
Default arguments are not allowed in declared or called functions.
static clang::FrontendPluginRegistry::Add< clang::tidy::ClangTidyPluginAction > X("clang-tidy", "clang-tidy")
Overloading operators is disallowed by the Fuchsia coding standard.
This module is for Fuchsia-specific checks.
volatile int FuchsiaModuleAnchorSource