clang 20.0.0git
Public Member Functions | List of all members
clang::ento::mpi::MPIChecker Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Checkers/MPI-Checker/MPIChecker.h"

Inheritance diagram for clang::ento::mpi::MPIChecker:
Inheritance graph
[legend]

Public Member Functions

 MPIChecker ()
 
void checkPreCall (const CallEvent &CE, CheckerContext &Ctx) const
 
void checkDeadSymbols (SymbolReaper &SymReaper, CheckerContext &Ctx) const
 
void dynamicInit (CheckerContext &Ctx) const
 
void checkDoubleNonblocking (const clang::ento::CallEvent &PreCallEvent, clang::ento::CheckerContext &Ctx) const
 Checks if a request is used by nonblocking calls multiple times in sequence without intermediate wait.
 
void checkUnmatchedWaits (const clang::ento::CallEvent &PreCallEvent, clang::ento::CheckerContext &Ctx) const
 Checks if the request used by the wait function was not used at all before.
 
void checkMissingWaits (clang::ento::SymbolReaper &SymReaper, clang::ento::CheckerContext &Ctx) const
 Check if a nonblocking call is not matched by a wait.
 
- Public Member Functions inherited from clang::ento::CheckerBase
StringRef getTagDescription () const override
 
CheckerNameRef getCheckerName () const
 
virtual void printState (raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) const
 See CheckerManager::runCheckersForPrintState.
 
- Public Member Functions inherited from clang::ProgramPointTag
 ProgramPointTag (void *tagKind=nullptr)
 
virtual ~ProgramPointTag ()
 
virtual StringRef getTagDescription () const =0
 
const void * getTagKind () const
 Used to implement 'isKind' in subclasses.
 

Additional Inherited Members

- Static Public Member Functions inherited from clang::ento::Checker< check::PreCall, check::DeadSymbols >
static void _register (CHECKER *checker, CheckerManager &mgr)
 
- Static Public Member Functions inherited from clang::ento::check::PreCall
template<typename CHECKER >
static void _register (CHECKER *checker, CheckerManager &mgr)
 

Detailed Description

Definition at line 30 of file MPIChecker.h.

Constructor & Destructor Documentation

◆ MPIChecker()

clang::ento::mpi::MPIChecker::MPIChecker ( )
inline

Definition at line 32 of file MPIChecker.h.

Member Function Documentation

◆ checkDeadSymbols()

void clang::ento::mpi::MPIChecker::checkDeadSymbols ( SymbolReaper SymReaper,
CheckerContext Ctx 
) const
inline

Definition at line 41 of file MPIChecker.h.

References checkMissingWaits(), and dynamicInit().

◆ checkDoubleNonblocking()

void clang::ento::mpi::MPIChecker::checkDoubleNonblocking ( const clang::ento::CallEvent PreCallEvent,
clang::ento::CheckerContext Ctx 
) const

◆ checkMissingWaits()

void clang::ento::mpi::MPIChecker::checkMissingWaits ( clang::ento::SymbolReaper SymReaper,
clang::ento::CheckerContext Ctx 
) const

Check if a nonblocking call is not matched by a wait.

If a memory region is not alive and the last function using the request was a nonblocking call, this is rated as a missing wait.

Definition at line 101 of file MPIChecker.cpp.

References clang::ento::CheckerContext::addTransition(), clang::ento::CheckerContext::generateNonFatalErrorNode(), clang::ento::CheckerContext::getBugReporter(), clang::ento::CheckerContext::getState(), clang::ento::SymbolReaper::isLiveRegion(), clang::ento::mpi::Request::Nonblocking, and clang::ento::mpi::MPIBugReporter::reportMissingWait().

Referenced by checkDeadSymbols().

◆ checkPreCall()

void clang::ento::mpi::MPIChecker::checkPreCall ( const CallEvent CE,
CheckerContext Ctx 
) const
inline

Definition at line 35 of file MPIChecker.h.

References checkDoubleNonblocking(), checkUnmatchedWaits(), and dynamicInit().

◆ checkUnmatchedWaits()

void clang::ento::mpi::MPIChecker::checkUnmatchedWaits ( const clang::ento::CallEvent PreCallEvent,
clang::ento::CheckerContext Ctx 
) const

Checks if the request used by the wait function was not used at all before.

The check contains a guard, in order to only inspect wait functions.

Parameters
PreCallEventMPI call to verify

Definition at line 57 of file MPIChecker.cpp.

References clang::ento::CheckerContext::addTransition(), clang::ento::CheckerContext::generateNonFatalErrorNode(), clang::ento::CheckerContext::getBugReporter(), clang::ento::CallEvent::getCalleeIdentifier(), clang::ento::CheckerContext::getState(), clang::ento::SubRegion::getSuperRegion(), clang::ento::mpi::MPIBugReporter::reportUnmatchedWait(), and clang::ento::mpi::Request::Wait.

Referenced by checkPreCall().

◆ dynamicInit()

void clang::ento::mpi::MPIChecker::dynamicInit ( CheckerContext Ctx) const
inline

Definition at line 46 of file MPIChecker.h.

References clang::ento::CheckerContext::getASTContext().

Referenced by checkDeadSymbols(), and checkPreCall().


The documentation for this class was generated from the following files: