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"
14#include "SIMDIntrinsicsCheck.h"
17
18namespace clang::tidy {
19namespace portability {
20
22public:
23 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
24 CheckFactories.registerCheck<AvoidPragmaOnceCheck>(
25 "portability-avoid-pragma-once");
27 "portability-restrict-system-includes");
28 CheckFactories.registerCheck<SIMDIntrinsicsCheck>(
29 "portability-simd-intrinsics");
31 "portability-std-allocator-const");
33 "portability-template-virtual-member-function");
34 }
35};
36
37// Register the PortabilityModule using this statically initialized variable.
38static ClangTidyModuleRegistry::Add<PortabilityModule>
39 X("portability-module", "Adds portability-related checks.");
40
41} // namespace portability
42
43// This anchor is used to force the linker to link in the generated object file
44// and thus register the PortabilityModule.
45// NOLINTNEXTLINE(misc-use-internal-linkage)
47
48} // namespace clang::tidy
A collection of ClangTidyCheckFactory instances.
void registerCheck(llvm::StringRef CheckName)
Registers the CheckType with the name Name.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Finds uses of #pragma once and suggests replacing them with standard / include guards (#ifndef/#defin...
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module.
Checks for allowed includes and suggests removal of any others.
Find SIMD intrinsics calls and suggest std::experimental::simd alternatives.
Report use of std::vector<const T> (and similar containers of const / elements).
Upon instantiating a template class, non-virtual member functions don't have to be instantiated unles...
static ClangTidyModuleRegistry::Add< PortabilityModule > X("portability-module", "Adds portability-related checks.")
volatile int PortabilityModuleAnchorSource