mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-20 03:55:48 -04:00

This check verifies if buffer type and MPI (Message Passing Interface) datatype pairs match. All MPI datatypes defined by the MPI standard (3.1) are verified by this check. User defined typedefs, custom MPI datatypes and null pointer constants are skipped, in the course of verification. Instructions on how to apply the check can be found at: https://github.com/0ax1/MPI-Checker/tree/master/examples Patch by Alexander Droste! Differential revision: https://reviews.llvm.org/D21962 llvm-svn: 277516
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
//===--- MPITidyModule.cpp - clang-tidy -----------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "../ClangTidy.h"
|
|
#include "../ClangTidyModule.h"
|
|
#include "../ClangTidyModuleRegistry.h"
|
|
#include "TypeMismatchCheck.h"
|
|
|
|
namespace clang {
|
|
namespace tidy {
|
|
namespace mpi {
|
|
|
|
class MPIModule : public ClangTidyModule {
|
|
public:
|
|
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
|
|
CheckFactories.registerCheck<TypeMismatchCheck>("mpi-type-mismatch");
|
|
}
|
|
};
|
|
|
|
} // namespace mpi
|
|
|
|
// Register the MPITidyModule using this statically initialized variable.
|
|
static ClangTidyModuleRegistry::Add<mpi::MPIModule>
|
|
X("mpi-module", "Adds MPI clang-tidy checks.");
|
|
|
|
// This anchor is used to force the linker to link in the generated object file
|
|
// and thus register the MPIModule.
|
|
volatile int MPIModuleAnchorSource = 0;
|
|
|
|
} // namespace tidy
|
|
} // namespace clang
|