clang-tools 8.0.0

PortabilityTidyModule.cpp
Go to the documentation of this file.
1 //===--- PortabilityTidyModule.cpp - clang-tidy ---------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "../ClangTidy.h"
11 #include "../ClangTidyModule.h"
12 #include "../ClangTidyModuleRegistry.h"
13 #include "SIMDIntrinsicsCheck.h"
14
15 namespace clang {
16 namespace tidy {
17 namespace portability {
18
19 class PortabilityModule : public ClangTidyModule {
20 public:
21 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
22 CheckFactories.registerCheck<SIMDIntrinsicsCheck>(
23 "portability-simd-intrinsics");
24 }
25 };
26
27 // Register the PortabilityModule using this statically initialized variable.
28 static ClangTidyModuleRegistry::Add<PortabilityModule>
29 X("portability-module", "Adds portability-related checks.");
30
31 } // namespace portability
32
33 // This anchor is used to force the linker to link in the generated object file
34 // and thus register the PortabilityModule.
35 volatile int PortabilityModuleAnchorSource = 0;
36
37 } // namespace tidy
38 } // namespace clang
clang::tidy::ClangTidyCheckFactories::registerCheck
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
Definition: ClangTidyModule.h:59
clang::tidy::portability::PortabilityModule
Definition: PortabilityTidyModule.cpp:19
clang::tidy::ClangTidyCheckFactories
A collection of ClangTidyCheckFactory instances.
Definition: ClangTidyModule.h:27
clang::tidy::portability::PortabilityModule::addCheckFactories
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
Definition: PortabilityTidyModule.cpp:21
SIMDIntrinsicsCheck.h
clang::tidy::ClangTidyModule
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Definition: ClangTidyModule.h:84
clang::tidy::PortabilityModuleAnchorSource
volatile int PortabilityModuleAnchorSource
Definition: PortabilityTidyModule.cpp:35
clang::tidy::portability::SIMDIntrinsicsCheck
Find SIMD intrinsics calls and suggest std::experimental::simd alternatives.
Definition: SIMDIntrinsicsCheck.h:25
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ChangeNamespace.cpp:18
clang::tidy::portability::X
static ClangTidyModuleRegistry::Add< PortabilityModule > X("portability-module", "Adds portability-related checks.")