MPITidyModule.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //===--- MPITidyModule.cpp - clang-tidy -----------------------------------===//
  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. #include "../ClangTidy.h"
  9. #include "../ClangTidyModule.h"
  10. #include "../ClangTidyModuleRegistry.h"
  11. #include "BufferDerefCheck.h"
  12. #include "TypeMismatchCheck.h"
  13. namespace clang::tidy {
  14. namespace mpi {
  15. class MPIModule : public ClangTidyModule {
  16. public:
  17. void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
  18. CheckFactories.registerCheck<BufferDerefCheck>("mpi-buffer-deref");
  19. CheckFactories.registerCheck<TypeMismatchCheck>("mpi-type-mismatch");
  20. }
  21. };
  22. } // namespace mpi
  23. // Register the MPITidyModule using this statically initialized variable.
  24. static ClangTidyModuleRegistry::Add<mpi::MPIModule>
  25. X("mpi-module", "Adds MPI clang-tidy checks.");
  26. // This anchor is used to force the linker to link in the generated object file
  27. // and thus register the MPIModule.
  28. volatile int MPIModuleAnchorSource = 0;
  29. } // namespace clang::tidy