clang-tools
20.0.0git
llvm-project
clang-tools-extra
clang-tidy
mpi
TypeMismatchCheck.h
Go to the documentation of this file.
1
//===--- TypeMismatchCheck.h - clang-tidy------------------------*- C++ -*-===//
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
9
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
10
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
11
12
#include "../ClangTidyCheck.h"
13
#include "clang/ASTMatchers/ASTMatchFinder.h"
14
#include "clang/StaticAnalyzer/Checkers/MPIFunctionClassifier.h"
15
#include <optional>
16
17
namespace
clang::tidy::mpi
{
18
19
/// This check verifies if buffer type and MPI (Message Passing Interface)
20
/// datatype pairs match. All MPI datatypes defined by the MPI standard (3.1)
21
/// are verified by this check. User defined typedefs, custom MPI datatypes and
22
/// null pointer constants are skipped, in the course of verification.
23
///
24
/// For the user-facing documentation see:
25
/// http://clang.llvm.org/extra/clang-tidy/checks/mpi/type-mismatch.html
26
class
TypeMismatchCheck
:
public
ClangTidyCheck
{
27
public
:
28
TypeMismatchCheck
(StringRef
Name
,
ClangTidyContext
*Context)
29
:
ClangTidyCheck
(
Name
, Context) {}
30
31
void
registerMatchers
(ast_matchers::MatchFinder *Finder)
override
;
32
void
check
(
const
ast_matchers::MatchFinder::MatchResult &Result)
override
;
33
34
void
onEndOfTranslationUnit
()
override
;
35
36
private
:
37
/// Check if the buffer type MPI datatype pairs match.
38
///
39
/// \param BufferTypes buffer types
40
/// \param BufferExprs buffer arguments as expressions
41
/// \param MPIDatatypes MPI datatype
42
/// \param LO language options
43
void
checkArguments(ArrayRef<const Type *> BufferTypes,
44
ArrayRef<const Expr *> BufferExprs,
45
ArrayRef<StringRef> MPIDatatypes,
const
LangOptions &LO);
46
47
std::optional<ento::mpi::MPIFunctionClassifier> FuncClassifier;
48
};
49
50
}
// namespace clang::tidy::mpi
51
52
#endif
// LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_MPI_TYPE_MISMATCH_H
Name
llvm::SmallString< 256U > Name
Definition:
ChainedComparisonCheck.cpp:42
clang::tidy::ClangTidyCheck
Base class for all clang-tidy checks.
Definition:
ClangTidyCheck.h:53
clang::tidy::ClangTidyContext
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Definition:
ClangTidyDiagnosticConsumer.h:69
clang::tidy::mpi::TypeMismatchCheck
This check verifies if buffer type and MPI (Message Passing Interface) datatype pairs match.
Definition:
TypeMismatchCheck.h:26
clang::tidy::mpi::TypeMismatchCheck::TypeMismatchCheck
TypeMismatchCheck(StringRef Name, ClangTidyContext *Context)
Definition:
TypeMismatchCheck.h:28
clang::tidy::mpi::TypeMismatchCheck::registerMatchers
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
Definition:
TypeMismatchCheck.cpp:235
clang::tidy::mpi::TypeMismatchCheck::onEndOfTranslationUnit
void onEndOfTranslationUnit() override
Definition:
TypeMismatchCheck.cpp:330
clang::tidy::mpi::TypeMismatchCheck::check
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
Definition:
TypeMismatchCheck.cpp:239
clang::tidy::mpi
Definition:
BufferDerefCheck.cpp:16
Generated on Thu Nov 21 2024 14:01:06 for clang-tools by
1.9.6