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"
18#include "TrailingReturnCheck.h"
20
21using namespace clang::ast_matchers;
22
23namespace clang::tidy {
24namespace fuchsia {
25namespace {
26
27/// This module is for Fuchsia-specific checks.
28class FuchsiaModule : public ClangTidyModule {
29public:
30 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
31 CheckFactories.registerCheck<DefaultArgumentsCallsCheck>(
32 "fuchsia-default-arguments-calls");
33 CheckFactories.registerCheck<DefaultArgumentsDeclarationsCheck>(
34 "fuchsia-default-arguments-declarations");
35 CheckFactories.registerCheck<misc::AnonymousNamespaceInHeaderCheck>(
36 "fuchsia-header-anon-namespaces");
37 CheckFactories.registerCheck<misc::MultipleInheritanceCheck>(
38 "fuchsia-multiple-inheritance");
39 CheckFactories.registerCheck<OverloadedOperatorCheck>(
40 "fuchsia-overloaded-operator");
41 CheckFactories.registerCheck<StaticallyConstructedObjectsCheck>(
42 "fuchsia-statically-constructed-objects");
43 CheckFactories.registerCheck<TemporaryObjectsCheck>(
44 "fuchsia-temporary-objects");
45 CheckFactories.registerCheck<TrailingReturnCheck>(
46 "fuchsia-trailing-return");
47 CheckFactories.registerCheck<VirtualInheritanceCheck>(
48 "fuchsia-virtual-inheritance");
49 }
50};
51
52} // namespace
53
54// Register the FuchsiaTidyModule using this statically initialized variable.
55static ClangTidyModuleRegistry::Add<FuchsiaModule>
56 X("fuchsia-module", "Adds Fuchsia platform checks.");
57} // namespace fuchsia
58
59// This anchor is used to force the linker to link in the generated object file
60// and thus register the FuchsiaModule.
61volatile int FuchsiaModuleAnchorSource = 0; // NOLINT(misc-use-internal-linkage)
62
63} // namespace clang::tidy
static ClangTidyModuleRegistry::Add< FuchsiaModule > X("fuchsia-module", "Adds Fuchsia platform checks.")
volatile int FuchsiaModuleAnchorSource