clang-tools 6.0.0

MPITidyModule.cpp
Go to the documentation of this file.
1 //===--- MPITidyModule.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 "BufferDerefCheck.h"
14 #include "TypeMismatchCheck.h"
15
16 namespace clang {
17 namespace tidy {
18 namespace mpi {
19
20 class MPIModule : public ClangTidyModule {
21 public:
22 void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
23 CheckFactories.registerCheck<BufferDerefCheck>("mpi-buffer-deref");
24 CheckFactories.registerCheck<TypeMismatchCheck>("mpi-type-mismatch");
25 }
26 };
27
28 } // namespace mpi
29
30 // Register the MPITidyModule using this statically initialized variable.
31 static ClangTidyModuleRegistry::Add<mpi::MPIModule>
32 X("mpi-module", "Adds MPI clang-tidy checks.");
33
34 // This anchor is used to force the linker to link in the generated object file
35 // and thus register the MPIModule.
36 volatile int MPIModuleAnchorSource = 0;
37
38 } // namespace tidy
39 } // namespace clang
clang::tidy::mpi::MPIModule
Definition: MPITidyModule.cpp:20
clang::tidy::mpi::TypeMismatchCheck
This check verifies if buffer type and MPI (Message Passing Interface) datatype pairs match...
Definition: TypeMismatchCheck.h:27
clang::tidy::ClangTidyCheckFactories::registerCheck
void registerCheck(StringRef CheckName)
Registers the CheckType with the name Name.
Definition: ClangTidyModule.h:59
clang::tidy::ClangTidyCheckFactories
A collection of ClangTidyCheckFactory instances.
Definition: ClangTidyModule.h:27
clang::tidy::mpi::MPIModule::addCheckFactories
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module...
Definition: MPITidyModule.cpp:22
clang::tidy::ClangTidyModule
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Definition: ClangTidyModule.h:84
clang::tidy::MPIModuleAnchorSource
volatile int MPIModuleAnchorSource
Definition: MPITidyModule.cpp:36
TypeMismatchCheck.h
clang::tidy::X
static ClangTidyModuleRegistry::Add< bugprone::BugproneModule > X("bugprone-module", "Adds checks for bugprone code constructs.")
clang::tidy::mpi::BufferDerefCheck
This check verifies if a buffer passed to an MPI (Message Passing Interface) function is sufficiently...
Definition: BufferDerefCheck.h:28
clang
Definition: AndroidTidyModule.cpp:28
BufferDerefCheck.h