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