File indexing completed on 2026-05-10 08:37:06
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_CLANG_STATICANALYZER_CHECKERS_MPIFUNCTIONCLASSIFIER_H
0015 #define LLVM_CLANG_STATICANALYZER_CHECKERS_MPIFUNCTIONCLASSIFIER_H
0016
0017 #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
0018
0019 namespace clang {
0020 namespace ento {
0021 namespace mpi {
0022
0023 class MPIFunctionClassifier {
0024 public:
0025 MPIFunctionClassifier(ASTContext &ASTCtx) { identifierInit(ASTCtx); }
0026
0027
0028 bool isMPIType(const IdentifierInfo *const IdentInfo) const;
0029 bool isNonBlockingType(const IdentifierInfo *const IdentInfo) const;
0030
0031
0032 bool isPointToPointType(const IdentifierInfo *const IdentInfo) const;
0033
0034
0035 bool isCollectiveType(const IdentifierInfo *const IdentInfo) const;
0036 bool isCollToColl(const IdentifierInfo *const IdentInfo) const;
0037 bool isScatterType(const IdentifierInfo *const IdentInfo) const;
0038 bool isGatherType(const IdentifierInfo *const IdentInfo) const;
0039 bool isAllgatherType(const IdentifierInfo *const IdentInfo) const;
0040 bool isAlltoallType(const IdentifierInfo *const IdentInfo) const;
0041 bool isReduceType(const IdentifierInfo *const IdentInfo) const;
0042 bool isBcastType(const IdentifierInfo *const IdentInfo) const;
0043
0044
0045 bool isMPI_Wait(const IdentifierInfo *const IdentInfo) const;
0046 bool isMPI_Waitall(const IdentifierInfo *const IdentInfo) const;
0047 bool isWaitType(const IdentifierInfo *const IdentInfo) const;
0048
0049 private:
0050
0051 void identifierInit(ASTContext &ASTCtx);
0052 void initPointToPointIdentifiers(ASTContext &ASTCtx);
0053 void initCollectiveIdentifiers(ASTContext &ASTCtx);
0054 void initAdditionalIdentifiers(ASTContext &ASTCtx);
0055
0056
0057
0058 llvm::SmallVector<IdentifierInfo *, 12> MPINonBlockingTypes;
0059
0060 llvm::SmallVector<IdentifierInfo *, 10> MPIPointToPointTypes;
0061 llvm::SmallVector<IdentifierInfo *, 16> MPICollectiveTypes;
0062
0063 llvm::SmallVector<IdentifierInfo *, 4> MPIPointToCollTypes;
0064 llvm::SmallVector<IdentifierInfo *, 4> MPICollToPointTypes;
0065 llvm::SmallVector<IdentifierInfo *, 6> MPICollToCollTypes;
0066
0067 llvm::SmallVector<IdentifierInfo *, 32> MPIType;
0068
0069
0070 IdentifierInfo *IdentInfo_MPI_Send = nullptr, *IdentInfo_MPI_Isend = nullptr,
0071 *IdentInfo_MPI_Ssend = nullptr, *IdentInfo_MPI_Issend = nullptr,
0072 *IdentInfo_MPI_Bsend = nullptr, *IdentInfo_MPI_Ibsend = nullptr,
0073 *IdentInfo_MPI_Rsend = nullptr, *IdentInfo_MPI_Irsend = nullptr,
0074 *IdentInfo_MPI_Recv = nullptr, *IdentInfo_MPI_Irecv = nullptr;
0075
0076
0077 IdentifierInfo *IdentInfo_MPI_Scatter = nullptr,
0078 *IdentInfo_MPI_Iscatter = nullptr, *IdentInfo_MPI_Gather = nullptr,
0079 *IdentInfo_MPI_Igather = nullptr, *IdentInfo_MPI_Allgather = nullptr,
0080 *IdentInfo_MPI_Iallgather = nullptr, *IdentInfo_MPI_Bcast = nullptr,
0081 *IdentInfo_MPI_Ibcast = nullptr, *IdentInfo_MPI_Reduce = nullptr,
0082 *IdentInfo_MPI_Ireduce = nullptr, *IdentInfo_MPI_Allreduce = nullptr,
0083 *IdentInfo_MPI_Iallreduce = nullptr, *IdentInfo_MPI_Alltoall = nullptr,
0084 *IdentInfo_MPI_Ialltoall = nullptr, *IdentInfo_MPI_Barrier = nullptr;
0085
0086
0087 IdentifierInfo *IdentInfo_MPI_Comm_rank = nullptr,
0088 *IdentInfo_MPI_Comm_size = nullptr, *IdentInfo_MPI_Wait = nullptr,
0089 *IdentInfo_MPI_Waitall = nullptr;
0090 };
0091
0092 }
0093 }
0094 }
0095
0096 #endif