clang-tools  7.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 "../google/UnnamedNamespaceInHeaderCheck.h"
14 #include "DefaultArgumentsCheck.h"
19 #include "TrailingReturnCheck.h"
21 
22 using namespace clang::ast_matchers;
23 
24 namespace clang {
25 namespace tidy {
26 namespace fuchsia {
27 
28 /// This module is for Fuchsia-specific checks.
30 public:
31  void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
32  CheckFactories.registerCheck<DefaultArgumentsCheck>(
33  "fuchsia-default-arguments");
35  "fuchsia-header-anon-namespaces");
37  "fuchsia-multiple-inheritance");
38  CheckFactories.registerCheck<OverloadedOperatorCheck>(
39  "fuchsia-overloaded-operator");
41  "fuchsia-restrict-system-includes");
43  "fuchsia-statically-constructed-objects");
44  CheckFactories.registerCheck<TrailingReturnCheck>(
45  "fuchsia-trailing-return");
46  CheckFactories.registerCheck<VirtualInheritanceCheck>(
47  "fuchsia-virtual-inheritance");
48  }
49 };
50 // Register the FuchsiaTidyModule using this statically initialized variable.
51 static ClangTidyModuleRegistry::Add<FuchsiaModule>
52  X("fuchsia-module", "Adds Fuchsia platform checks.");
53 } // namespace fuchsia
54 
55 // This anchor is used to force the linker to link in the generated object file
56 // and thus register the FuchsiaModule.
57 volatile int FuchsiaModuleAnchorSource = 0;
58 
59 } // namespace tidy
60 } // namespace clang
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
Checks for allowed includes and suggests removal of any others.
Functions that have trailing returns are disallowed, except for those using decltype specifiers and l...
A collection of ClangTidyCheckFactory instances.
Constructing global, non-trivial objects with static storage is disallowed, unless the object is stat...
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.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
static ClangTidyModuleRegistry::Add< FuchsiaModule > X("fuchsia-module", "Adds Fuchsia platform checks.")
Overloading operators is disallowed by the Fuchsia coding standard.
This module is for Fuchsia-specific checks.
Mulitple implementation inheritance is discouraged.
volatile int FuchsiaModuleAnchorSource