clang-tools 22.0.0git
FuchsiaTidyModule.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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"
19#include "TrailingReturnCheck.h"
21
22using namespace clang::ast_matchers;
23
24namespace clang::tidy {
25namespace fuchsia {
26
27/// This module is for Fuchsia-specific checks.
29public:
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");
40 "fuchsia-overloaded-operator");
42 "fuchsia-statically-constructed-objects");
44 "fuchsia-temporary-objects");
45 CheckFactories.registerCheck<TrailingReturnCheck>(
46 "fuchsia-trailing-return");
48 "fuchsia-virtual-inheritance");
49 }
50};
51// Register the FuchsiaTidyModule using this statically initialized variable.
52static ClangTidyModuleRegistry::Add<FuchsiaModule>
53 X("fuchsia-module", "Adds Fuchsia platform checks.");
54} // namespace fuchsia
55
56// This anchor is used to force the linker to link in the generated object file
57// and thus register the FuchsiaModule.
58volatile int FuchsiaModuleAnchorSource = 0; // NOLINT(misc-use-internal-linkage)
59
60} // namespace clang::tidy
A collection of ClangTidyCheckFactory instances.
void registerCheck(llvm::StringRef CheckName)
Registers the CheckType with the name Name.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Default arguments are not allowed in called functions.
Default parameters are not allowed in declared functions.
This module is for Fuchsia-specific checks.
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module.
Multiple implementation inheritance is discouraged.
Overloading operators is disallowed by the Fuchsia coding standard.
Constructing global, non-trivial objects with static storage is disallowed, unless the object is stat...
Construction of specific temporary objects in the Zircon kernel is discouraged.
Functions that have trailing returns are disallowed, except for those using decltype specifiers and l...
Defining classes with virtual inheritance is disallowed.
static ClangTidyModuleRegistry::Add< FuchsiaModule > X("fuchsia-module", "Adds Fuchsia platform checks.")
volatile int FuchsiaModuleAnchorSource