clang-tools 22.0.0git
PortabilityTidyModule.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"
13#include "SIMDIntrinsicsCheck.h"
16
17namespace clang::tidy {
18namespace portability {
19namespace {
20
21class PortabilityModule : public ClangTidyModule {
22public:
23 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
24 CheckFactories.registerCheck<AvoidPragmaOnceCheck>(
25 "portability-avoid-pragma-once");
26 CheckFactories.registerCheck<RestrictSystemIncludesCheck>(
27 "portability-restrict-system-includes");
28 CheckFactories.registerCheck<SIMDIntrinsicsCheck>(
29 "portability-simd-intrinsics");
30 CheckFactories.registerCheck<StdAllocatorConstCheck>(
31 "portability-std-allocator-const");
32 CheckFactories.registerCheck<TemplateVirtualMemberFunctionCheck>(
33 "portability-template-virtual-member-function");
34 }
35};
36
37} // namespace
38
39// Register the PortabilityModule using this statically initialized variable.
40static ClangTidyModuleRegistry::Add<PortabilityModule>
41 X("portability-module", "Adds portability-related checks.");
42
43} // namespace portability
44
45// This anchor is used to force the linker to link in the generated object file
46// and thus register the PortabilityModule.
47// NOLINTNEXTLINE(misc-use-internal-linkage)
49
50} // namespace clang::tidy
static ClangTidyModuleRegistry::Add< PortabilityModule > X("portability-module", "Adds portability-related checks.")
volatile int PortabilityModuleAnchorSource