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