clang-tools  10.0.0git
FuchsiaTidyModule.cpp
Go to the documentation of this file.
1 //===--- FuchsiaTidyModule.cpp - clang-tidy -------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "../ClangTidy.h"
10 #include "../ClangTidyModule.h"
11 #include "../ClangTidyModuleRegistry.h"
12 #include "../google/UnnamedNamespaceInHeaderCheck.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 {
33  "fuchsia-default-arguments-calls");
35  "fuchsia-default-arguments-declarations");
37  "fuchsia-header-anon-namespaces");
39  "fuchsia-multiple-inheritance");
40  CheckFactories.registerCheck<OverloadedOperatorCheck>(
41  "fuchsia-overloaded-operator");
43  "fuchsia-restrict-system-includes");
45  "fuchsia-statically-constructed-objects");
46  CheckFactories.registerCheck<TrailingReturnCheck>(
47  "fuchsia-trailing-return");
48  CheckFactories.registerCheck<VirtualInheritanceCheck>(
49  "fuchsia-virtual-inheritance");
50  }
51 };
52 // Register the FuchsiaTidyModule using this statically initialized variable.
53 static ClangTidyModuleRegistry::Add<FuchsiaModule>
54  X("fuchsia-module", "Adds Fuchsia platform checks.");
55 } // namespace fuchsia
56 
57 // This anchor is used to force the linker to link in the generated object file
58 // and thus register the FuchsiaModule.
59 volatile int FuchsiaModuleAnchorSource = 0;
60 
61 } // namespace tidy
62 } // 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...
Default arguments are not allowed in called functions.
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...
===– 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.
Default parameters are not allowed in declared functions.
This module is for Fuchsia-specific checks.
Mulitple implementation inheritance is discouraged.
volatile int FuchsiaModuleAnchorSource