clang 22.0.0git
Public Types | Public Member Functions | List of all members
clang::ento::CheckerManager Class Reference

#include "clang/StaticAnalyzer/Core/CheckerManager.h"

Public Types

using  CheckerTag = const void *
using  CheckDeclFunc
using  HandlesDeclFunc = bool (*)(const Decl *D)
using  CheckStmtFunc = CheckerFn<void (const Stmt *, CheckerContext &)>
using  CheckCallFunc
using  CheckBindFunc
using  EvalAssumeFunc
using  HandlesStmtFunc = bool (*)(const Stmt *D)
using  EventTag = void *
using  CheckEventFunc = CheckerFn<void (const void *event)>

Public Member Functions

  CheckerManager (ASTContext &Context, AnalyzerOptions &AOptions, const Preprocessor &PP, ArrayRef< std::string > plugins, ArrayRef< std::function< void(CheckerRegistry &)> > checkerRegistrationFns)
  CheckerManager (ASTContext &Context, AnalyzerOptions &AOptions, const Preprocessor &PP)
  Constructs a CheckerManager that ignores all non TblGen-generated checkers.
  CheckerManager (AnalyzerOptions &AOptions, const LangOptions &LangOpts, DiagnosticsEngine &Diags, ArrayRef< std::string > plugins)
  Constructs a CheckerManager without requiring an AST.
const LangOptionsgetLangOpts () const
const PreprocessorgetPreprocessor () const
void  reportInvalidCheckerOptionValue (const CheckerFrontend *Checker, StringRef OptionName, StringRef ExpectedValueDesc) const
  Emits an error through a DiagnosticsEngine about an invalid user supplied checker option value.
template<typename CHECKER, typename... AT>
CHECKERgetChecker (AT &&...Args)
  If the the singleton instance of a checker class is not yet constructed, then construct it (with the supplied arguments), register it for the callbacks that are supported by it, and return it.
template<typename CHECKER, typename... AT>
CHECKERregisterChecker (AT &&...Args)
  Register a single-part checker (derived from Checker ): construct its singleton instance, register it for the supported callbacks and record its name (with CheckerFrontend::enable ).
template<typename CHECKER>
  Run checkers handling Decls.
  Run checkers handling Decls containing a Stmt body.
void  runCheckersForPreStmt (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng)
  Run checkers for pre-visiting Stmts.
void  runCheckersForPostStmt (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng, bool wasInlined=false)
  Run checkers for post-visiting Stmts.
void  runCheckersForStmt (bool isPreVisit, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const Stmt *S, ExprEngine &Eng, bool wasInlined=false)
  Run checkers for visiting Stmts.
  Run checkers for pre-visiting obj-c messages.
void  runCheckersForPostObjCMessage (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng, bool wasInlined=false)
  Run checkers for post-visiting obj-c messages.
  Run checkers for visiting an obj-c message to nil.
void  runCheckersForObjCMessage (ObjCMessageVisitKind visitKind, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng, bool wasInlined=false)
  Run checkers for visiting obj-c messages.
  Run checkers for pre-visiting obj-c messages.
void  runCheckersForPostCall (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng, bool wasInlined=false)
  Run checkers for post-visiting obj-c messages.
void  runCheckersForCallEvent (bool isPreVisit, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng, bool wasInlined=false)
  Run checkers for visiting obj-c messages.
void  runCheckersForLocation (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, SVal location, bool isLoad, const Stmt *NodeEx, const Stmt *BoundEx, ExprEngine &Eng)
  Run checkers for load/store of a location.
void  runCheckersForBind (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, SVal location, SVal val, const Stmt *S, bool AtDeclInit, ExprEngine &Eng, const ProgramPoint &PP)
  Run checkers for binding of a value to a location.
void  runCheckersForBlockEntrance (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const BlockEntrance &Entrance, ExprEngine &Eng) const
  Run checkers after taking a control flow edge.
  Run checkers for end of analysis.
  Run checkers on beginning of function.
  Run checkers on end of function.
void  runCheckersForBranchCondition (const Stmt *condition, ExplodedNodeSet &Dst, ExplodedNode *Pred, ExprEngine &Eng)
  Run checkers for branch condition.
  Run checkers between C++ operator new and constructor calls.
  Run checkers for live symbols.
  Run checkers for dead symbols.
ProgramStateRef  runCheckersForRegionChanges (ProgramStateRef state, const InvalidatedSymbols *invalidated, ArrayRef< const MemRegion * > ExplicitRegions, ArrayRef< const MemRegion * > Regions, const LocationContext *LCtx, const CallEvent *Call)
  Run checkers for region changes.
  Run checkers when pointers escape.
  Run checkers for handling assumptions on symbolic values.
void  runCheckersForEvalCall (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &CE, ExprEngine &Eng, const EvalCallOptions &CallOpts)
  Run checkers for evaluating a call.
  Run checkers for the entire Translation Unit.
void  runCheckersForPrintStateJson (raw_ostream &Out, ProgramStateRef State, const char *NL="\n", unsigned int Space=0, bool IsDot=false) const
  Run checkers for debug-printing a ProgramState.
void  _registerForDecl (CheckDeclFunc checkfn, HandlesDeclFunc isForDeclFn)
void  _registerForPreStmt (CheckStmtFunc checkfn, HandlesStmtFunc isForStmtFn)
void  _registerForPostStmt (CheckStmtFunc checkfn, HandlesStmtFunc isForStmtFn)
template<typename EVENT>
template<typename EVENT>
template<typename EVENT>
void  _dispatchEvent (const EVENT &event) const

Detailed Description

Definition at line 126 of file CheckerManager.h.

Member Typedef Documentation

◆  CheckBeginFunctionFunc

Definition at line 510 of file CheckerManager.h.

◆  CheckBindFunc

Initial value:
CheckerFn<void(SVal location, SVal val, const Stmt *S,
bool AtDeclInit, CheckerContext &)>
Stmt - This represents one statement.
Definition Stmt.h:85
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
Definition SVals.h:56

Definition at line 501 of file CheckerManager.h.

◆  CheckBlockEntranceFunc

Initial value:

Definition at line 504 of file CheckerManager.h.

◆  CheckBranchConditionFunc

Initial value:
CheckerFn<void (const Stmt *, CheckerContext &)>

Definition at line 515 of file CheckerManager.h.

◆  CheckCallFunc

Initial value:
CheckerFn<void (const CallEvent &, CheckerContext &)>
Represents an abstract call to a function or method along a particular path.
Definition CallEvent.h:153

Definition at line 495 of file CheckerManager.h.

◆  CheckDeadSymbolsFunc

Initial value:
A class responsible for cleaning up unused symbols.

Definition at line 521 of file CheckerManager.h.

◆  CheckDeclFunc

Initial value:
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
BugReporter is a utility class for generating PathDiagnostics for analysis.
Definition BugReporter.h:586

Definition at line 477 of file CheckerManager.h.

◆  CheckEndAnalysisFunc

Initial value:

Definition at line 507 of file CheckerManager.h.

◆  CheckEndFunctionFunc

Initial value:
CheckerFn<void (const ReturnStmt *, CheckerContext &)>
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition Stmt.h:3139

Definition at line 512 of file CheckerManager.h.

◆  CheckEndOfTranslationUnit

Initial value:
The top declaration context.
Definition Decl.h:105

Definition at line 545 of file CheckerManager.h.

◆  CheckerTag

Definition at line 188 of file CheckerManager.h.

◆  CheckEventFunc

using clang::ento::CheckerManager::CheckEventFunc = CheckerFn<void (const void *event)>

Definition at line 600 of file CheckerManager.h.

◆  CheckLiveSymbolsFunc

Definition at line 524 of file CheckerManager.h.

◆  CheckLocationFunc

Initial value:
CheckerFn<void(SVal location, bool isLoad,
const Stmt *S, CheckerContext &)>

Definition at line 498 of file CheckerManager.h.

◆  CheckNewAllocatorFunc

Initial value:
Represents the memory allocation call in a C++ new-expression.
Definition CallEvent.h:1130

Definition at line 518 of file CheckerManager.h.

◆  CheckObjCMessageFunc

Initial value:
Represents any expression that calls an Objective-C method.
Definition CallEvent.h:1261

Definition at line 492 of file CheckerManager.h.

◆  CheckPointerEscapeFunc

Initial value:
const InvalidatedSymbols &Escaped,
Information about invalidation for a particular region/symbol.
Definition MemRegion.h:1657
PointerEscapeKind
Describes the different reasons a pointer escapes during analysis.
llvm::DenseSet< SymbolRef > InvalidatedSymbols
Definition Store.h:51
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef

Definition at line 534 of file CheckerManager.h.

◆  CheckRegionChangesFunc

Initial value:
const InvalidatedSymbols *symbols,
ArrayRef<const MemRegion *> ExplicitRegions,
const LocationContext *LCtx,
const CallEvent *Call)>
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...

Definition at line 526 of file CheckerManager.h.

◆  CheckStmtFunc

Definition at line 490 of file CheckerManager.h.

◆  EvalAssumeFunc

Initial value:
CheckerFn<ProgramStateRef(ProgramStateRef, SVal cond, bool assumption)>

Definition at line 540 of file CheckerManager.h.

◆  EvalCallFunc

Definition at line 543 of file CheckerManager.h.

◆  EventTag

Definition at line 599 of file CheckerManager.h.

◆  HandlesDeclFunc

Definition at line 480 of file CheckerManager.h.

◆  HandlesStmtFunc

Definition at line 549 of file CheckerManager.h.

Constructor & Destructor Documentation

◆  CheckerManager() [1/3]

clang::ento::CheckerManager::CheckerManager ( ASTContext & Context,
AnalyzerOptions & AOptions,
const Preprocessor & PP,
ArrayRef< std::string > plugins,
ArrayRef< std::function< void(CheckerRegistry &)> > checkerRegistrationFns )

Definition at line 23 of file CreateCheckerManager.cpp.

References std::function, getDiagnostics(), and getLangOpts().

Referenced by CheckerManager().

◆  CheckerManager() [2/3]

clang::ento::CheckerManager::CheckerManager ( ASTContext & Context,
AnalyzerOptions & AOptions,
const Preprocessor & PP )
inline

Constructs a CheckerManager that ignores all non TblGen-generated checkers.

Useful for unit testing, unless the checker infrastructure itself is tested.

Definition at line 150 of file CheckerManager.h.

References CheckerManager().

◆  CheckerManager() [3/3]

clang::ento::CheckerManager::CheckerManager ( AnalyzerOptions & AOptions,
const LangOptions & LangOpts,
ArrayRef< std::string > plugins )

Constructs a CheckerManager without requiring an AST.

No checker registration will take place. Only useful when one needs to print the help flags through CheckerRegistryData, and the AST is unavailable.

Definition at line 36 of file CreateCheckerManager.cpp.

References clang::ento::CheckerRegistry::initializeRegistry().

◆  ~CheckerManager()

clang::ento::CheckerManager::~CheckerManager ( )
default

Member Function Documentation

◆  _dispatchEvent()

template<typename EVENT>
void clang::ento::CheckerManager::_dispatchEvent ( const EVENT & event ) const
inline

Definition at line 615 of file CheckerManager.h.

◆  _registerDispatcherForEvent()

template<typename EVENT>
void clang::ento::CheckerManager::_registerDispatcherForEvent ( )
inline

Definition at line 609 of file CheckerManager.h.

Referenced by clang::ento::EventDispatcher< EVENT >::_register().

◆  _registerForBeginFunction()

void CheckerManager::_registerForBeginFunction ( CheckBeginFunctionFunc checkfn )

Definition at line 927 of file CheckerManager.cpp.

Referenced by clang::ento::check::BeginFunction::_register().

◆  _registerForBind()

void CheckerManager::_registerForBind ( CheckBindFunc checkfn )

Definition at line 915 of file CheckerManager.cpp.

Referenced by clang::ento::check::Bind::_register().

◆  _registerForBlockEntrance()

void CheckerManager::_registerForBlockEntrance ( CheckBlockEntranceFunc checkfn )

Definition at line 919 of file CheckerManager.cpp.

Referenced by clang::ento::check::BlockEntrance::_register().

◆  _registerForBody()

void CheckerManager::_registerForBody ( CheckDeclFunc checkfn )

Definition at line 872 of file CheckerManager.cpp.

Referenced by clang::ento::check::ASTCodeBody::_register().

◆  _registerForBranchCondition()

void CheckerManager::_registerForBranchCondition ( CheckBranchConditionFunc checkfn )

Definition at line 935 of file CheckerManager.cpp.

Referenced by clang::ento::check::BranchCondition::_register().

◆  _registerForConstPointerEscape()

void CheckerManager::_registerForConstPointerEscape ( CheckPointerEscapeFunc checkfn )

Definition at line 960 of file CheckerManager.cpp.

◆  _registerForDeadSymbols()

void CheckerManager::_registerForDeadSymbols ( CheckDeadSymbolsFunc checkfn )

Definition at line 948 of file CheckerManager.cpp.

Referenced by clang::ento::check::DeadSymbols::_register().

◆  _registerForDecl()

void CheckerManager::_registerForDecl ( CheckDeclFunc checkfn,
HandlesDeclFunc isForDeclFn )

Definition at line 866 of file CheckerManager.cpp.

Referenced by clang::ento::check::ASTDecl< DECL >::_register().

◆  _registerForEndAnalysis()

void CheckerManager::_registerForEndAnalysis ( CheckEndAnalysisFunc checkfn )

Definition at line 923 of file CheckerManager.cpp.

Referenced by clang::ento::check::EndAnalysis::_register().

◆  _registerForEndFunction()

void CheckerManager::_registerForEndFunction ( CheckEndFunctionFunc checkfn )

Definition at line 931 of file CheckerManager.cpp.

Referenced by clang::ento::check::EndFunction::_register().

◆  _registerForEndOfTranslationUnit()

void CheckerManager::_registerForEndOfTranslationUnit ( CheckEndOfTranslationUnit checkfn )

Definition at line 973 of file CheckerManager.cpp.

Referenced by clang::ento::check::EndOfTranslationUnit::_register().

◆  _registerForEvalAssume()

void CheckerManager::_registerForEvalAssume ( EvalAssumeFunc checkfn )

Definition at line 965 of file CheckerManager.cpp.

Referenced by clang::ento::eval::Assume::_register().

◆  _registerForEvalCall()

void CheckerManager::_registerForEvalCall ( EvalCallFunc checkfn )

Definition at line 969 of file CheckerManager.cpp.

Referenced by clang::ento::eval::Call::_register().

◆  _registerForLiveSymbols()

void CheckerManager::_registerForLiveSymbols ( CheckLiveSymbolsFunc checkfn )

Definition at line 944 of file CheckerManager.cpp.

Referenced by clang::ento::check::LiveSymbols::_register().

◆  _registerForLocation()

void CheckerManager::_registerForLocation ( CheckLocationFunc checkfn )

Definition at line 911 of file CheckerManager.cpp.

Referenced by clang::ento::check::Location::_register().

◆  _registerForNewAllocator()

void CheckerManager::_registerForNewAllocator ( CheckNewAllocatorFunc checkfn )

Definition at line 940 of file CheckerManager.cpp.

Referenced by clang::ento::check::NewAllocator::_register().

◆  _registerForObjCMessageNil()

void CheckerManager::_registerForObjCMessageNil ( CheckObjCMessageFunc checkfn )

Definition at line 896 of file CheckerManager.cpp.

Referenced by clang::ento::check::ObjCMessageNil::_register().

◆  _registerForPointerEscape()

void CheckerManager::_registerForPointerEscape ( CheckPointerEscapeFunc checkfn )

Definition at line 956 of file CheckerManager.cpp.

Referenced by clang::ento::check::ConstPointerEscape::_register(), and clang::ento::check::PointerEscape::_register().

◆  _registerForPostCall()

void CheckerManager::_registerForPostCall ( CheckCallFunc checkfn )

Definition at line 907 of file CheckerManager.cpp.

Referenced by clang::ento::check::PostCall::_register().

◆  _registerForPostObjCMessage()

void CheckerManager::_registerForPostObjCMessage ( CheckObjCMessageFunc checkfn )

Definition at line 900 of file CheckerManager.cpp.

Referenced by clang::ento::check::PostObjCMessage::_register().

◆  _registerForPostStmt()

void CheckerManager::_registerForPostStmt ( CheckStmtFunc checkfn,
HandlesStmtFunc isForStmtFn )

Definition at line 886 of file CheckerManager.cpp.

Referenced by clang::ento::check::PostStmt< STMT >::_register().

◆  _registerForPreCall()

void CheckerManager::_registerForPreCall ( CheckCallFunc checkfn )

Definition at line 904 of file CheckerManager.cpp.

Referenced by clang::ento::check::PreCall::_register().

◆  _registerForPreObjCMessage()

void CheckerManager::_registerForPreObjCMessage ( CheckObjCMessageFunc checkfn )

Definition at line 892 of file CheckerManager.cpp.

Referenced by clang::ento::check::PreObjCMessage::_register().

◆  _registerForPreStmt()

void CheckerManager::_registerForPreStmt ( CheckStmtFunc checkfn,
HandlesStmtFunc isForStmtFn )

Definition at line 880 of file CheckerManager.cpp.

Referenced by clang::ento::check::PreStmt< STMT >::_register().

◆  _registerForRegionChanges()

void CheckerManager::_registerForRegionChanges ( CheckRegionChangesFunc checkfn )

Definition at line 952 of file CheckerManager.cpp.

Referenced by clang::ento::check::RegionChanges::_register().

◆  _registerListenerForEvent()

template<typename EVENT>
void clang::ento::CheckerManager::_registerListenerForEvent ( CheckEventFunc checkfn )
inline

Definition at line 603 of file CheckerManager.h.

Referenced by clang::ento::check::Event< EVENT >::_register().

◆  getAnalyzerOptions()

const AnalyzerOptions & clang::ento::CheckerManager::getAnalyzerOptions ( ) const
inline

Definition at line 168 of file CheckerManager.h.

◆  getASTContext()

ASTContext & clang::ento::CheckerManager::getASTContext ( ) const
inline

Definition at line 177 of file CheckerManager.h.

Referenced by clang::ento::getConfiguration().

◆  getChecker()

template<typename CHECKER, typename... AT>
CHECKER * clang::ento::CheckerManager::getChecker ( AT &&... Args )
inline

If the the singleton instance of a checker class is not yet constructed, then construct it (with the supplied arguments), register it for the callbacks that are supported by it, and return it.

Otherwise, just return a pointer to the existing instance.

Definition at line 199 of file CheckerManager.h.

References CHECKER.

Referenced by REGISTER_MAP_WITH_PROGRAMSTATE(), registerChecker(), and clang::ento::registerInnerPointerCheckerAux().

◆  getCheckerRegistryData()

const CheckerRegistryData & clang::ento::CheckerManager::getCheckerRegistryData ( ) const
inline

Definition at line 173 of file CheckerManager.h.

◆  getCurrentCheckerName()

CheckerNameRef clang::ento::CheckerManager::getCurrentCheckerName ( ) const
inline

Definition at line 163 of file CheckerManager.h.

Referenced by clang::ento::CheckerFrontend::enable().

◆  getDiagnostics()

DiagnosticsEngine & clang::ento::CheckerManager::getDiagnostics ( ) const
inline

Definition at line 176 of file CheckerManager.h.

Referenced by CheckerManager(), and reportInvalidCheckerOptionValue().

◆  getLangOpts()

const LangOptions & clang::ento::CheckerManager::getLangOpts ( ) const
inline

Definition at line 167 of file CheckerManager.h.

Referenced by CheckerManager().

◆  getPreprocessor()

const Preprocessor & clang::ento::CheckerManager::getPreprocessor ( ) const
inline

Definition at line 169 of file CheckerManager.h.

◆  hasPathSensitiveCheckers()

bool CheckerManager::hasPathSensitiveCheckers ( ) const

Definition at line 37 of file CheckerManager.cpp.

◆  isRegisteredChecker()

template<typename CHECKER>
bool clang::ento::CheckerManager::isRegisteredChecker ( )
inline

Definition at line 224 of file CheckerManager.h.

◆  registerChecker()

template<typename CHECKER, typename... AT>
CHECKER * clang::ento::CheckerManager::registerChecker ( AT &&... Args )
inline

Register a single-part checker (derived from Checker ): construct its singleton instance, register it for the supported callbacks and record its name (with CheckerFrontend::enable ).

Calling this multiple times triggers an assertion failure.

Definition at line 218 of file CheckerManager.h.

References CHECKER, and getChecker().

Referenced by clang::ento::registerCheckerDocumentationChecker().

◆  reportInvalidCheckerOptionValue()

void CheckerManager::reportInvalidCheckerOptionValue ( const CheckerFrontend * Checker,
StringRef OptionName,
StringRef ExpectedValueDesc ) const

Emits an error through a DiagnosticsEngine about an invalid user supplied checker option value.

Definition at line 51 of file CheckerManager.cpp.

References getDiagnostics(), clang::ento::CheckerFrontend::getName(), and clang::DiagnosticsEngine::Report().

Referenced by clang::ento::getConfiguration(), and REGISTER_MAP_WITH_PROGRAMSTATE().

◆  runCheckersForBeginFunction()

void CheckerManager::runCheckersForBeginFunction ( ExplodedNodeSet & Dst,
const BlockEdge & L,
ExplodedNode * Pred,
ExprEngine & Eng )

Run checkers on beginning of function.

Definition at line 494 of file CheckerManager.cpp.

References clang::C, expandGraphWithCheckers(), and clang::ento::ExplodedNodeSet::insert().

Referenced by clang::ento::ExprEngine::processBeginOfFunction().

◆  runCheckersForBind()

void CheckerManager::runCheckersForBind ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
SVal location,
SVal val,
const Stmt * S,
bool AtDeclInit,
ExprEngine & Eng,
const ProgramPoint & PP )

Run checkers for binding of a value to a location.

Definition at line 411 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

◆  runCheckersForBlockEntrance()

void CheckerManager::runCheckersForBlockEntrance ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const BlockEntrance & Entrance,
ExprEngine & Eng ) const

Run checkers after taking a control flow edge.

Definition at line 450 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

Referenced by clang::ento::ExprEngine::runCheckersForBlockEntrance().

◆  runCheckersForBranchCondition()

void CheckerManager::runCheckersForBranchCondition ( const Stmt * condition,
ExplodedNode * Pred,
ExprEngine & Eng )

Run checkers for branch condition.

Definition at line 556 of file CheckerManager.cpp.

References clang::C, clang::Condition, expandGraphWithCheckers(), and clang::ento::ExplodedNodeSet::insert().

Referenced by clang::ento::ExprEngine::processBranch().

◆  runCheckersForCallEvent()

void CheckerManager::runCheckersForCallEvent ( bool isPreVisit,
const ExplodedNodeSet & Src,
const CallEvent & Call,
ExprEngine & Eng,
bool wasInlined = false  )

Run checkers for visiting obj-c messages.

Run checkers for visiting an abstract call event.

Definition at line 298 of file CheckerManager.cpp.

References clang::C, clang::Call, and expandGraphWithCheckers().

Referenced by runCheckersForPostCall(), and runCheckersForPreCall().

◆  runCheckersForDeadSymbols()

void CheckerManager::runCheckersForDeadSymbols ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
SymbolReaper & SymReaper,
const Stmt * S,
ExprEngine & Eng,

Run checkers for dead symbols.

Notifies checkers when symbols become dead. For example, this allows checkers to aggressively clean up/reduce the checker state and produce precise diagnostics.

Definition at line 656 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

Referenced by clang::ento::ExprEngine::removeDead().

◆  runCheckersForEndAnalysis()

void CheckerManager::runCheckersForEndAnalysis ( ExplodedGraph & G,
BugReporter & BR,
ExprEngine & Eng )

Run checkers for end of analysis.

Definition at line 459 of file CheckerManager.cpp.

Referenced by clang::ento::ExprEngine::processEndWorklist().

◆  runCheckersForEndFunction()

void CheckerManager::runCheckersForEndFunction ( NodeBuilderContext & BC,
ExplodedNode * Pred,
ExprEngine & Eng,
const ReturnStmt * RS )

Run checkers on end of function.

Run checkers for end of path.

Definition at line 508 of file CheckerManager.cpp.

References clang::C, and clang::ento::ExplodedNode::getLocationContext().

Referenced by clang::ento::ExprEngine::processEndOfFunction().

◆  runCheckersForEvalAssume()

ProgramStateRef CheckerManager::runCheckersForEvalAssume ( ProgramStateRef state,
SVal Cond,
bool Assumption )

Run checkers for handling assumptions on symbolic values.

Definition at line 709 of file CheckerManager.cpp.

References clang::Cond.

Referenced by clang::ento::ExprEngine::processAssume().

◆  runCheckersForEvalCall()

void CheckerManager::runCheckersForEvalCall ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const CallEvent & Call,
ExprEngine & Eng,
const EvalCallOptions & CallOpts )

Run checkers for evaluating a call.

Warning: Currently, the CallEvent MUST come from a CallExpr!

Only one checker will evaluate the call.

Definition at line 723 of file CheckerManager.cpp.

References clang::C, clang::Call, clang::ento::ExprEngine::defaultEvalCall(), clang::ento::ExprEngine::getBuilderContext(), clang::ento::ExplodedNode::getLocationContext(), clang::ProgramPoint::getProgramPoint(), clang::ento::ExplodedNode::getState(), clang::ento::ExplodedNodeSet::insert(), clang::ento::OS, clang::ProgramPoint::PostStmtKind, and toString().

Referenced by clang::ento::ExprEngine::evalCall().

◆  runCheckersForLiveSymbols()

void CheckerManager::runCheckersForLiveSymbols ( ProgramStateRef state,
SymbolReaper & SymReaper )

Run checkers for live symbols.

Allows modifying SymbolReaper object. For example, checkers can explicitly register symbols of interest as live. These symbols will not be marked dead and removed.

Definition at line 613 of file CheckerManager.cpp.

Referenced by clang::ento::ExprEngine::removeDead().

◆  runCheckersForLocation()

void CheckerManager::runCheckersForLocation ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
SVal location,
bool isLoad,
const Stmt * NodeEx,
const Stmt * BoundEx,
ExprEngine & Eng )

Run checkers for load/store of a location.

Definition at line 354 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

◆  runCheckersForNewAllocator()

void CheckerManager::runCheckersForNewAllocator ( const CXXAllocatorCall & Call,
ExplodedNode * Pred,
ExprEngine & Eng,
bool wasInlined = false  )

Run checkers between C++ operator new and constructor calls.

Definition at line 600 of file CheckerManager.cpp.

References clang::C, clang::Call, expandGraphWithCheckers(), and clang::ento::ExplodedNodeSet::insert().

Referenced by clang::ento::ExprEngine::processCallExit(), and clang::ento::ExprEngine::VisitCXXNewAllocatorCall().

◆  runCheckersForObjCMessage()

void CheckerManager::runCheckersForObjCMessage ( ObjCMessageVisitKind visitKind,
const ExplodedNodeSet & Src,
const ObjCMethodCall & msg,
ExprEngine & Eng,
bool wasInlined = false  )

Run checkers for visiting obj-c messages.

Definition at line 238 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

Referenced by runCheckersForObjCMessageNil(), runCheckersForPostObjCMessage(), and runCheckersForPreObjCMessage().

◆  runCheckersForObjCMessageNil()

void clang::ento::CheckerManager::runCheckersForObjCMessageNil ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const ObjCMethodCall & msg,
ExprEngine & Eng )
inline

Run checkers for visiting an obj-c message to nil.

Definition at line 296 of file CheckerManager.h.

References clang::ento::MessageNil, and runCheckersForObjCMessage().

Referenced by clang::ento::ExprEngine::VisitObjCMessage().

◆  runCheckersForPointerEscape()

ProgramStateRef CheckerManager::runCheckersForPointerEscape ( ProgramStateRef State,
const InvalidatedSymbols & Escaped,
const CallEvent * Call,

Run checkers when pointers escape.

Run checkers to process symbol escape event.

This notifies the checkers about pointer escape, which occurs whenever the analyzer cannot track the symbol any more. For example, as a result of assigning a pointer into a global or when it's passed to a function call the analyzer cannot model.

Parameters
State The state at the point of escape.
Escaped The list of escaped symbols.
Call The corresponding CallEvent, if the symbols escape as parameters to the given call.
Kind The reason of pointer escape.
ITraits Information about invalidation for a particular region/symbol.
Returns
Checkers can modify the state by returning a new one.

Definition at line 688 of file CheckerManager.cpp.

References clang::Call, clang::ento::PSK_DirectEscapeOnCall, and clang::ento::PSK_IndirectEscapeOnCall.

Referenced by clang::ento::ExprEngine::escapeValues(), and clang::ento::ExprEngine::notifyCheckersOfPointerEscape().

◆  runCheckersForPostCall()

void clang::ento::CheckerManager::runCheckersForPostCall ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const CallEvent & Call,
ExprEngine & Eng,
bool wasInlined = false  )
inline

Run checkers for post-visiting obj-c messages.

Definition at line 318 of file CheckerManager.h.

References clang::Call, and runCheckersForCallEvent().

Referenced by clang::ento::ExprEngine::evalCall(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::VisitCXXDeleteExpr(), clang::ento::ExprEngine::VisitCXXDestructor(), clang::ento::ExprEngine::VisitCXXNewAllocatorCall(), and clang::ento::ExprEngine::VisitObjCMessage().

◆  runCheckersForPostObjCMessage()

void clang::ento::CheckerManager::runCheckersForPostObjCMessage ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const ObjCMethodCall & msg,
ExprEngine & Eng,
bool wasInlined = false  )
inline

Run checkers for post-visiting obj-c messages.

Definition at line 286 of file CheckerManager.h.

References clang::ento::Post, and runCheckersForObjCMessage().

Referenced by clang::ento::ExprEngine::processCallExit(), and clang::ento::ExprEngine::VisitObjCMessage().

◆  runCheckersForPostStmt()

void clang::ento::CheckerManager::runCheckersForPostStmt ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const Stmt * S,
ExprEngine & Eng,
bool wasInlined = false  )
inline

Run checkers for post-visiting Stmts.

The notification is performed for every explored CFGElement, which does not include the control flow statements such as IfStmt.

See also
runCheckersForBranchCondition, runCheckersForPreStmt

Definition at line 263 of file CheckerManager.h.

References runCheckersForStmt().

Referenced by clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::Visit(), clang::ento::ExprEngine::VisitArrayInitLoopExpr(), clang::ento::ExprEngine::VisitArraySubscriptExpr(), clang::ento::ExprEngine::VisitAtomicExpr(), clang::ento::ExprEngine::VisitAttributedStmt(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitBlockExpr(), clang::ento::ExprEngine::VisitCallExpr(), clang::ento::ExprEngine::VisitDeclStmt(), clang::ento::ExprEngine::VisitLambdaExpr(), clang::ento::ExprEngine::VisitLvalObjCIvarRefExpr(), clang::ento::ExprEngine::VisitMemberExpr(), clang::ento::ExprEngine::VisitObjCForCollectionStmt(), clang::ento::ExprEngine::VisitUnaryExprOrTypeTraitExpr(), and clang::ento::ExprEngine::VisitUnaryOperator().

◆  runCheckersForPreCall()

void clang::ento::CheckerManager::runCheckersForPreCall ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const CallEvent & Call,
ExprEngine & Eng )
inline

Run checkers for pre-visiting obj-c messages.

Definition at line 312 of file CheckerManager.h.

References clang::Call, and runCheckersForCallEvent().

Referenced by clang::ento::ExprEngine::evalCall(), clang::ento::ExprEngine::VisitCXXDeleteExpr(), clang::ento::ExprEngine::VisitCXXDestructor(), clang::ento::ExprEngine::VisitCXXNewAllocatorCall(), and clang::ento::ExprEngine::VisitObjCMessage().

◆  runCheckersForPreObjCMessage()

void clang::ento::CheckerManager::runCheckersForPreObjCMessage ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const ObjCMethodCall & msg,
ExprEngine & Eng )
inline

Run checkers for pre-visiting obj-c messages.

Definition at line 278 of file CheckerManager.h.

References clang::ento::Pre, and runCheckersForObjCMessage().

Referenced by clang::ento::ExprEngine::VisitObjCMessage().

◆  runCheckersForPreStmt()

void clang::ento::CheckerManager::runCheckersForPreStmt ( ExplodedNodeSet & Dst,
const ExplodedNodeSet & Src,
const Stmt * S,
ExprEngine & Eng )
inline

Run checkers for pre-visiting Stmts.

The notification is performed for every explored CFGElement, which does not include the control flow statements such as IfStmt.

See also
runCheckersForBranchCondition, runCheckersForPostStmt

Definition at line 250 of file CheckerManager.h.

References runCheckersForStmt().

Referenced by clang::ento::ExprEngine::Visit(), clang::ento::ExprEngine::VisitArrayInitLoopExpr(), clang::ento::ExprEngine::VisitArraySubscriptExpr(), clang::ento::ExprEngine::VisitAtomicExpr(), clang::ento::ExprEngine::VisitAttributedStmt(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitCallExpr(), clang::ento::ExprEngine::VisitCast(), clang::ento::ExprEngine::VisitDeclStmt(), clang::ento::ExprEngine::VisitMemberExpr(), clang::ento::ExprEngine::VisitObjCAtSynchronizedStmt(), clang::ento::ExprEngine::VisitReturnStmt(), clang::ento::ExprEngine::VisitUnaryExprOrTypeTraitExpr(), and clang::ento::ExprEngine::VisitUnaryOperator().

◆  runCheckersForPrintStateJson()

void CheckerManager::runCheckersForPrintStateJson ( raw_ostream & Out,
const char * NL = "\n",
unsigned int Space = 0,
bool IsDot = false  ) const

Run checkers for debug-printing a ProgramState.

Unlike most other callbacks, any checker can simply implement the virtual method CheckerBackend::printState if it has custom data to print.

Parameters
Out The output stream
State The state being printed
NL The preferred representation of a newline.
Space The preferred space between the left side and the message.
IsDot Whether the message will be printed in 'dot' format.

Definition at line 794 of file CheckerManager.cpp.

References clang::Indent().

Referenced by clang::ento::ExprEngine::printJson().

◆  runCheckersForRegionChanges()

ProgramStateRef CheckerManager::runCheckersForRegionChanges ( ProgramStateRef state,
const InvalidatedSymbols * invalidated,
ArrayRef< const MemRegion * > ExplicitRegions,
ArrayRef< const MemRegion * > Regions,
const LocationContext * LCtx,
const CallEvent * Call )

Run checkers for region changes.

This corresponds to the check::RegionChanges callback.

Parameters
state The current program state.
invalidated A set of all symbols potentially touched by the change.
ExplicitRegions The regions explicitly requested for invalidation. For example, in the case of a function call, these would be arguments.
Regions The transitive closure of accessible regions, i.e. all regions that may have been touched by this change.
Call The call expression wrapper if the regions are invalidated by a call.

Definition at line 669 of file CheckerManager.cpp.

References clang::Call.

Referenced by clang::ento::ExprEngine::processRegionChanges().

◆  runCheckersForStmt()

void CheckerManager::runCheckersForStmt ( bool isPreVisit,
const ExplodedNodeSet & Src,
const Stmt * S,
ExprEngine & Eng,
bool wasInlined = false  )

Run checkers for visiting Stmts.

Definition at line 177 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

Referenced by runCheckersForPostStmt(), and runCheckersForPreStmt().

◆  runCheckersOnASTBody()

void CheckerManager::runCheckersOnASTBody ( const Decl * D,
BugReporter & BR )

Run checkers handling Decls containing a Stmt body.

Definition at line 83 of file CheckerManager.cpp.

References clang::Decl::hasBody().

◆  runCheckersOnASTDecl()

void CheckerManager::runCheckersOnASTDecl ( const Decl * D,
BugReporter & BR )

Run checkers handling Decls.

Definition at line 64 of file CheckerManager.cpp.

References clang::Decl::getKind().

◆  runCheckersOnEndOfTranslationUnit()

void CheckerManager::runCheckersOnEndOfTranslationUnit ( const TranslationUnitDecl * TU,
BugReporter & BR )

Run checkers for the entire Translation Unit.

Definition at line 786 of file CheckerManager.cpp.

◆  setCurrentCheckerName()

void clang::ento::CheckerManager::setCurrentCheckerName ( CheckerNameRef name )
inline

Definition at line 162 of file CheckerManager.h.

Referenced by clang::ento::CheckerRegistry::initializeManager().


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

Generated on for clang by doxygen 1.14.0

AltStyle によって変換されたページ (->オリジナル) /