15e0a50c2SAlexander Kornienko //===--- MPITidyModule.cpp - clang-tidy -----------------------------------===// 25e0a50c2SAlexander Kornienko // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 65e0a50c2SAlexander Kornienko // 75e0a50c2SAlexander Kornienko //===----------------------------------------------------------------------===// 85e0a50c2SAlexander Kornienko 95e0a50c2SAlexander Kornienko #include "../ClangTidy.h" 105e0a50c2SAlexander Kornienko #include "../ClangTidyModule.h" 115e0a50c2SAlexander Kornienko #include "../ClangTidyModuleRegistry.h" 121512f9a0SAlexander Droste #include "BufferDerefCheck.h" 135e0a50c2SAlexander Kornienko #include "TypeMismatchCheck.h" 145e0a50c2SAlexander Kornienko 15*7d2ea6c4SCarlos Galvez namespace clang::tidy { 165e0a50c2SAlexander Kornienko namespace mpi { 175e0a50c2SAlexander Kornienko 185e0a50c2SAlexander Kornienko class MPIModule : public ClangTidyModule { 195e0a50c2SAlexander Kornienko public: addCheckFactories(ClangTidyCheckFactories & CheckFactories)205e0a50c2SAlexander Kornienko void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override { 211512f9a0SAlexander Droste CheckFactories.registerCheck<BufferDerefCheck>("mpi-buffer-deref"); 225e0a50c2SAlexander Kornienko CheckFactories.registerCheck<TypeMismatchCheck>("mpi-type-mismatch"); 235e0a50c2SAlexander Kornienko } 245e0a50c2SAlexander Kornienko }; 255e0a50c2SAlexander Kornienko 265e0a50c2SAlexander Kornienko } // namespace mpi 275e0a50c2SAlexander Kornienko 285e0a50c2SAlexander Kornienko // Register the MPITidyModule using this statically initialized variable. 295e0a50c2SAlexander Kornienko static ClangTidyModuleRegistry::Add<mpi::MPIModule> 305e0a50c2SAlexander Kornienko X("mpi-module", "Adds MPI clang-tidy checks."); 315e0a50c2SAlexander Kornienko 325e0a50c2SAlexander Kornienko // This anchor is used to force the linker to link in the generated object file 335e0a50c2SAlexander Kornienko // and thus register the MPIModule. 345e0a50c2SAlexander Kornienko volatile int MPIModuleAnchorSource = 0; 355e0a50c2SAlexander Kornienko 36*7d2ea6c4SCarlos Galvez } // namespace clang::tidy 37