15#ifndef LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MPICHECKER_MPIBUGREPORTER_H
16#define LLVM_CLANG_LIB_STATICANALYZER_CHECKERS_MPICHECKER_MPIBUGREPORTER_H
28 UnmatchedWaitBugType.reset(
new BugType(&CB,
"Unmatched wait", MPIError));
29 DoubleNonblockingBugType.reset(
30 new BugType(&CB,
"Double nonblocking", MPIError));
31 MissingWaitBugType.reset(
new BugType(&CB,
"Missing wait", MPIError));
71 const std::string MPIError =
"MPI Error";
74 std::unique_ptr<BugType> UnmatchedWaitBugType;
75 std::unique_ptr<BugType> MissingWaitBugType;
76 std::unique_ptr<BugType> DoubleNonblockingBugType;
82 RequestNodeVisitor(
const MemRegion *
const MemoryRegion,
83 const std::string &ErrText)
84 : RequestRegion(MemoryRegion), ErrorText(ErrText) {}
86 void Profile(llvm::FoldingSetNodeID &
ID)
const override {
89 ID.AddPointer(RequestRegion);
93 BugReporterContext &BRC,
94 PathSensitiveBugReport &BR)
override;
97 const MemRegion *
const RequestRegion;
98 bool IsNodeFound =
false;
99 std::string ErrorText;
This file provides definitions to model concepts of MPI.
BugReporterVisitors are used to add custom diagnostics along a path.
BugReporter is a utility class for generating PathDiagnostics for analysis.
Represents an abstract call to a function or method along a particular path.
MemRegion - The root abstract class for all memory regions.
void reportMissingWait(const Request &Req, const MemRegion *const RequestRegion, const ExplodedNode *const ExplNode, BugReporter &BReporter) const
Report a missing wait for a nonblocking call.
void reportDoubleNonblocking(const CallEvent &MPICallEvent, const Request &Req, const MemRegion *const RequestRegion, const ExplodedNode *const ExplNode, BugReporter &BReporter) const
Report duplicate request use by nonblocking calls without intermediate wait.
MPIBugReporter(const CheckerBase &CB)
void reportUnmatchedWait(const CallEvent &CE, const MemRegion *const RequestRegion, const ExplodedNode *const ExplNode, BugReporter &BReporter) const
Report a wait on a request that has not been used at all before.
std::shared_ptr< PathDiagnosticPiece > PathDiagnosticPieceRef