clang-tools  14.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"
18 #include "TrailingReturnCheck.h"
20 
21 using namespace clang::ast_matchers;
22 
23 namespace clang {
24 namespace tidy {
25 namespace fuchsia {
26 
27 /// This module is for Fuchsia-specific checks.
29 public:
30  void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
32  "fuchsia-default-arguments-calls");
34  "fuchsia-default-arguments-declarations");
36  "fuchsia-header-anon-namespaces");
38  "fuchsia-multiple-inheritance");
39  CheckFactories.registerCheck<OverloadedOperatorCheck>(
40  "fuchsia-overloaded-operator");
42  "fuchsia-statically-constructed-objects");
43  CheckFactories.registerCheck<TrailingReturnCheck>(
44  "fuchsia-trailing-return");
45  CheckFactories.registerCheck<VirtualInheritanceCheck>(
46  "fuchsia-virtual-inheritance");
47  }
48 };
49 // Register the FuchsiaTidyModule using this statically initialized variable.
50 static ClangTidyModuleRegistry::Add<FuchsiaModule>
51  X("fuchsia-module", "Adds Fuchsia platform checks.");
52 } // namespace fuchsia
53 
54 // This anchor is used to force the linker to link in the generated object file
55 // and thus register the FuchsiaModule.
56 volatile int FuchsiaModuleAnchorSource = 0;
57 
58 } // namespace tidy
59 } // namespace clang
OverloadedOperatorCheck.h
VirtualInheritanceCheck.h
clang::tidy::FuchsiaModuleAnchorSource
volatile int FuchsiaModuleAnchorSource
Definition: FuchsiaTidyModule.cpp:56
StaticallyConstructedObjectsCheck.h
clang::tidy::fuchsia::MultipleInheritanceCheck
Multiple implementation inheritance is discouraged.
Definition: MultipleInheritanceCheck.h:22
clang::tidy::fuchsia::FuchsiaModule
This module is for Fuchsia-specific checks.
Definition: FuchsiaTidyModule.cpp:28
clang::ast_matchers
Definition: AbseilMatcher.h:14
clang::tidy::fuchsia::DefaultArgumentsCallsCheck
Default arguments are not allowed in called functions.
Definition: DefaultArgumentsCallsCheck.h:22
clang::tidy::ClangTidyCheckFactories
A collection of ClangTidyCheckFactory instances.
Definition: ClangTidyModule.h:28
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:30
X
int X
Definition: LSPBinderTests.cpp:25
clang::tidy::google::build::UnnamedNamespaceInHeaderCheck
Finds anonymous namespaces in headers.
Definition: UnnamedNamespaceInHeaderCheck.h:36
DefaultArgumentsDeclarationsCheck.h
clang::tidy::fuchsia::VirtualInheritanceCheck
Defining classes with virtual inheritance is disallowed.
Definition: VirtualInheritanceCheck.h:22
TrailingReturnCheck.h
clang::tidy::fuchsia::StaticallyConstructedObjectsCheck
Constructing global, non-trivial objects with static storage is disallowed, unless the object is stat...
Definition: StaticallyConstructedObjectsCheck.h:24
DefaultArgumentsCallsCheck.h
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ApplyReplacements.h:27
clang::tidy::fuchsia::OverloadedOperatorCheck
Overloading operators is disallowed by the Fuchsia coding standard.
Definition: OverloadedOperatorCheck.h:22
clang::tidy::fuchsia::TrailingReturnCheck
Functions that have trailing returns are disallowed, except for those using decltype specifiers and l...
Definition: TrailingReturnCheck.h:24
clang::tidy::ClangTidyModule
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Definition: ClangTidyModule.h:81
MultipleInheritanceCheck.h
clang::tidy::ClangTidyCheckFactories::registerCheck
void registerCheck(llvm::StringRef CheckName)
Registers the CheckType with the name Name.
Definition: ClangTidyModule.h:59
clang::tidy::fuchsia::DefaultArgumentsDeclarationsCheck
Default parameters are not allowed in declared functions.
Definition: DefaultArgumentsDeclarationsCheck.h:22