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