30 std::string ErrorText;
31 ErrorText =
"Double nonblocking on request " +
34 auto Report = llvm::make_unique<BugReport>(*DoubleNonblockingBugType,
41 Report->addRange(Range);
43 Report->addVisitor(llvm::make_unique<RequestNodeVisitor>(
44 RequestRegion,
"Request is previously used by nonblocking call here. "));
45 Report->markInteresting(RequestRegion);
55 " has no matching wait. "};
58 llvm::make_unique<BugReport>(*MissingWaitBugType, ErrorText, ExplNode);
62 Report->addRange(Range);
63 Report->addVisitor(llvm::make_unique<RequestNodeVisitor>(
64 RequestRegion,
"Request is previously used by nonblocking call here. "));
65 Report->markInteresting(RequestRegion);
75 " has no matching nonblocking call. "};
78 llvm::make_unique<BugReport>(*UnmatchedWaitBugType, ErrorText, ExplNode);
83 Report->addRange(Range);
88 std::shared_ptr<PathDiagnosticPiece>
89 MPIBugReporter::RequestNodeVisitor::VisitNode(
const ExplodedNode *N,
101 if ((Req && !PrevReq) || (Req->
CurrentState != PrevReq->CurrentState)) {
108 return std::make_shared<PathDiagnosticEventPiece>(L, ErrorText);
MemRegion - The root abstract class for all memory regions.
A Range represents the closed range [from, to].
const ProgramStateRef & getState() const
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.
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.
void emitReport(std::unique_ptr< BugReport > R)
Add the given report to the set of reports tracked by BugReporter.
void reportMissingWait(const Request &Req, const MemRegion *const RequestRegion, const ExplodedNode *const ExplNode, BugReporter &BReporter) const
Report a missing wait for a nonblocking call.
static PathDiagnosticLocation create(const Decl *D, const SourceManager &SM)
Create a location corresponding to the given declaration.
ExplodedNode * getFirstPred()
SourceRange sourceRange() const
Retrieve source range from memory region.
This file defines the main class of MPI-Checker which serves as an entry point.
BugReporter is a utility class for generating PathDiagnostics for analysis.
virtual SourceRange getSourceRange() const
Returns a source range for the entire call, suitable for outputting in diagnostics.
ProgramPoint getLocation() const
getLocation - Returns the edge associated with the given node.
std::string getDescriptiveName(bool UseQuotes=true) const
Get descriptive name for memory region.
Dataflow Directional Tag Classes.
Represents an abstract call to a function or method along a particular path.
A trivial tuple used to represent a source range.
This class provides an interface through which checkers can create individual bug reports...
This file defines prefabricated reports which are emitted in case of MPI related bugs, detected by path-sensitive analysis.
SourceManager & getSourceManager()