clang-tools 23.0.0git
MiscTidyModule.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 "IncludeCleanerCheck.h"
21#include "MisplacedConstCheck.h"
24#include "NoRecursionCheck.h"
30#include "StaticAssertCheck.h"
40
41namespace clang::tidy {
42namespace misc {
43namespace {
44
45class MiscModule : public ClangTidyModule {
46public:
47 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
48 CheckFactories.registerCheck<AnonymousNamespaceInHeaderCheck>(
49 "misc-anonymous-namespace-in-header");
50 CheckFactories.registerCheck<ConfusableIdentifierCheck>(
51 "misc-confusable-identifiers");
52 CheckFactories.registerCheck<ConstCorrectnessCheck>(
53 "misc-const-correctness");
54 CheckFactories.registerCheck<CoroutineHostileRAIICheck>(
55 "misc-coroutine-hostile-raii");
56 CheckFactories.registerCheck<DefinitionsInHeadersCheck>(
57 "misc-definitions-in-headers");
58 CheckFactories.registerCheck<ExplicitConstructorCheck>(
59 "misc-explicit-constructor");
60 CheckFactories.registerCheck<HeaderIncludeCycleCheck>(
61 "misc-header-include-cycle");
62 CheckFactories.registerCheck<IncludeCleanerCheck>("misc-include-cleaner");
63 CheckFactories.registerCheck<MisleadingBidirectionalCheck>(
64 "misc-misleading-bidirectional");
65 CheckFactories.registerCheck<MisleadingIdentifierCheck>(
66 "misc-misleading-identifier");
67 CheckFactories.registerCheck<MisplacedConstCheck>("misc-misplaced-const");
68 CheckFactories.registerCheck<MultipleInheritanceCheck>(
69 "misc-multiple-inheritance");
70 CheckFactories.registerCheck<NewDeleteOverloadsCheck>(
71 "misc-new-delete-overloads");
72 CheckFactories.registerCheck<NoRecursionCheck>("misc-no-recursion");
73 CheckFactories.registerCheck<NonCopyableObjectsCheck>(
74 "misc-non-copyable-objects");
75 CheckFactories.registerCheck<NonPrivateMemberVariablesInClassesCheck>(
76 "misc-non-private-member-variables-in-classes");
77 CheckFactories.registerCheck<OverrideWithDifferentVisibilityCheck>(
78 "misc-override-with-different-visibility");
79 CheckFactories.registerCheck<PredictableRandCheck>("misc-predictable-rand");
80 CheckFactories.registerCheck<RedundantExpressionCheck>(
81 "misc-redundant-expression");
82 CheckFactories.registerCheck<StaticAssertCheck>("misc-static-assert");
83 CheckFactories.registerCheck<StaticInitializationCycleCheck>(
84 "misc-static-initialization-cycle");
85 CheckFactories.registerCheck<ThrowByValueCatchByReferenceCheck>(
86 "misc-throw-by-value-catch-by-reference");
87 CheckFactories.registerCheck<UnconventionalAssignOperatorCheck>(
88 "misc-unconventional-assign-operator");
89 CheckFactories.registerCheck<UniqueptrResetReleaseCheck>(
90 "misc-uniqueptr-reset-release");
91 CheckFactories.registerCheck<UnusedAliasDeclsCheck>(
92 "misc-unused-alias-decls");
93 CheckFactories.registerCheck<UnusedParametersCheck>(
94 "misc-unused-parameters");
95 CheckFactories.registerCheck<UnusedUsingDeclsCheck>(
96 "misc-unused-using-decls");
97 CheckFactories.registerCheck<UseAnonymousNamespaceCheck>(
98 "misc-use-anonymous-namespace");
99 CheckFactories.registerCheck<UseInternalLinkageCheck>(
100 "misc-use-internal-linkage");
101 }
102};
103
104} // namespace
105} // namespace misc
106
107// Register the MiscTidyModule using this statically initialized variable.
108static ClangTidyModuleRegistry::Add<misc::MiscModule>
109 X("misc-module", "Adds miscellaneous lint checks.");
110
111// This anchor is used to force the linker to link in the generated object file
112// and thus register the MiscModule.
113volatile int MiscModuleAnchorSource = 0; // NOLINT(misc-use-internal-linkage)
114
115} // namespace clang::tidy
static ClangTidyModuleRegistry::Add< altera::AlteraModule > X("altera-module", "Adds Altera FPGA OpenCL lint checks.")
volatile int MiscModuleAnchorSource