|
clang 24.0.0git
|
#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 | CheckObjCMessageFunc |
| using | CheckCallFunc |
| using | CheckLifetimeEndFunc |
| using | CheckLocationFunc |
| using | CheckBindFunc |
| using | CheckBlockEntranceFunc |
| using | CheckEndAnalysisFunc |
| using | CheckBeginFunctionFunc = CheckerFn<void (CheckerContext &)> |
| using | CheckEndFunctionFunc |
| using | CheckBranchConditionFunc |
| using | CheckNewAllocatorFunc |
| using | CheckDeadSymbolsFunc |
| using | CheckLiveSymbolsFunc = CheckerFn<void (ProgramStateRef,SymbolReaper &)> |
| using | CheckRegionChangesFunc |
| using | CheckPointerEscapeFunc |
| using | EvalAssumeFunc |
| using | EvalCallFunc = CheckerFn<bool (const CallEvent &, CheckerContext &)> |
| using | CheckEndOfTranslationUnit |
| 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. | |
| ~CheckerManager () | |
| void | setCurrentCheckerName (CheckerNameRef name) |
| CheckerNameRef | getCurrentCheckerName () const |
| bool | hasPathSensitiveCheckers () const |
| const LangOptions & | getLangOpts () const |
| const AnalyzerOptions & | getAnalyzerOptions () const |
| const Preprocessor & | getPreprocessor () const |
| const CheckerRegistryData & | getCheckerRegistryData () const |
| DiagnosticsEngine & | getDiagnostics () const |
| ASTContext & | getASTContext () 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> | |
| CHECKER * | getChecker (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> | |
| CHECKER * | registerChecker (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> | |
| bool | isRegisteredChecker () |
| void | runCheckersOnASTDecl (const Decl *D, AnalysisManager &mgr, BugReporter &BR) |
| Run checkers handling Decls. | |
| void | runCheckersOnASTBody (const Decl *D, AnalysisManager &mgr, BugReporter &BR) |
| 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. | |
| void | runCheckersForPreObjCMessage (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng) |
| 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. | |
| void | runCheckersForObjCMessageNil (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const ObjCMethodCall &msg, ExprEngine &Eng) |
| 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. | |
| void | runCheckersForPreCall (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng) |
| Run checkers for pre-visiting function calls (including methods, constructors, destructors etc. | |
| void | runCheckersForPostCall (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng, bool wasInlined=false) |
| Run checkers for post-visiting function calls (including methods, constructors, destructors etc. | |
| void | runCheckersForCallEvent (bool isPreVisit, ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const CallEvent &Call, ExprEngine &Eng, bool wasInlined=false) |
| Run checkers for visiting function calls (including methods, constructors, destructors etc. | |
| void | runCheckersForLifetimeEnd (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, const VarDecl *Decl, ExprEngine &Eng) |
| Run checkers for the end of a variable's lifetime. | |
| 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. | |
| void | runCheckersForEndAnalysis (ExplodedGraph &G, BugReporter &BR, ExprEngine &Eng) |
| Run checkers for end of analysis. | |
| void | runCheckersForBeginFunction (ExplodedNodeSet &Dst, const BlockEdge &L, ExplodedNode *Pred, ExprEngine &Eng) |
| Run checkers on beginning of function. | |
| void | runCheckersForEndFunction (ExplodedNodeSet &Dst, ExplodedNode *Pred, ExprEngine &Eng, const ReturnStmt *RS) |
| Run checkers on end of function. | |
| void | runCheckersForBranchCondition (const Stmt *condition, ExplodedNodeSet &Dst, ExplodedNode *Pred, ExprEngine &Eng) |
| Run checkers for branch condition. | |
| void | runCheckersForNewAllocator (const CXXAllocatorCall &Call, ExplodedNodeSet &Dst, ExplodedNode *Pred, ExprEngine &Eng, bool wasInlined=false) |
| Run checkers between C++ operator new and constructor calls. | |
| void | runCheckersForLiveSymbols (ProgramStateRef state, SymbolReaper &SymReaper) |
| Run checkers for live symbols. | |
| void | runCheckersForDeadSymbols (ExplodedNodeSet &Dst, const ExplodedNodeSet &Src, SymbolReaper &SymReaper, const Stmt *S, ExprEngine &Eng, ProgramPoint::Kind K) |
| Run checkers for dead symbols. | |
| ProgramStateRef | runCheckersForRegionChanges (ProgramStateRef state, const InvalidatedSymbols *invalidated, ArrayRef< const MemRegion * > ExplicitRegions, ArrayRef< const MemRegion * > Regions, const StackFrame *SF, const CallEvent *Call) |
| Run checkers for region changes. | |
| ProgramStateRef | runCheckersForPointerEscape (ProgramStateRef State, const InvalidatedSymbols &Escaped, const CallEvent *Call, PointerEscapeKind Kind, RegionAndSymbolInvalidationTraits *ITraits) |
| Run checkers when pointers escape. | |
| ProgramStateRef | runCheckersForEvalAssume (ProgramStateRef state, SVal Cond, bool Assumption) |
| 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. | |
| void | runCheckersOnEndOfTranslationUnit (const TranslationUnitDecl *TU, AnalysisManager &mgr, BugReporter &BR) |
| 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 | _registerForBody (CheckDeclFunc checkfn) |
| void | _registerForPreStmt (CheckStmtFunc checkfn, HandlesStmtFunc isForStmtFn) |
| void | _registerForPostStmt (CheckStmtFunc checkfn, HandlesStmtFunc isForStmtFn) |
| void | _registerForPreObjCMessage (CheckObjCMessageFunc checkfn) |
| void | _registerForPostObjCMessage (CheckObjCMessageFunc checkfn) |
| void | _registerForObjCMessageNil (CheckObjCMessageFunc checkfn) |
| void | _registerForPreCall (CheckCallFunc checkfn) |
| void | _registerForPostCall (CheckCallFunc checkfn) |
| void | _registerForLifetimeEnd (CheckLifetimeEndFunc checkfn) |
| void | _registerForLocation (CheckLocationFunc checkfn) |
| void | _registerForBind (CheckBindFunc checkfn) |
| void | _registerForBlockEntrance (CheckBlockEntranceFunc checkfn) |
| void | _registerForEndAnalysis (CheckEndAnalysisFunc checkfn) |
| void | _registerForBeginFunction (CheckBeginFunctionFunc checkfn) |
| void | _registerForEndFunction (CheckEndFunctionFunc checkfn) |
| void | _registerForBranchCondition (CheckBranchConditionFunc checkfn) |
| void | _registerForNewAllocator (CheckNewAllocatorFunc checkfn) |
| void | _registerForLiveSymbols (CheckLiveSymbolsFunc checkfn) |
| void | _registerForDeadSymbols (CheckDeadSymbolsFunc checkfn) |
| void | _registerForRegionChanges (CheckRegionChangesFunc checkfn) |
| void | _registerForPointerEscape (CheckPointerEscapeFunc checkfn) |
| void | _registerForConstPointerEscape (CheckPointerEscapeFunc checkfn) |
| void | _registerForEvalAssume (EvalAssumeFunc checkfn) |
| void | _registerForEvalCall (EvalCallFunc checkfn) |
| void | _registerForEndOfTranslationUnit (CheckEndOfTranslationUnit checkfn) |
| template<typename EVENT> | |
| void | _registerListenerForEvent (CheckEventFunc checkfn) |
| template<typename EVENT> | |
| void | _registerDispatcherForEvent () |
| template<typename EVENT> | |
| void | _dispatchEvent (const EVENT &event) const |
Definition at line 124 of file CheckerManager.h.
| using clang::ento::CheckerManager::CheckBeginFunctionFunc = CheckerFn<void (CheckerContext &)> |
Definition at line 515 of file CheckerManager.h.
Definition at line 506 of file CheckerManager.h.
Definition at line 509 of file CheckerManager.h.
Definition at line 520 of file CheckerManager.h.
Definition at line 497 of file CheckerManager.h.
Definition at line 526 of file CheckerManager.h.
Definition at line 479 of file CheckerManager.h.
Definition at line 512 of file CheckerManager.h.
Definition at line 517 of file CheckerManager.h.
Definition at line 548 of file CheckerManager.h.
| using clang::ento::CheckerManager::CheckerTag = const void * |
Definition at line 186 of file CheckerManager.h.
| using clang::ento::CheckerManager::CheckEventFunc = CheckerFn<void (const void *event)> |
Definition at line 605 of file CheckerManager.h.
Definition at line 500 of file CheckerManager.h.
| using clang::ento::CheckerManager::CheckLiveSymbolsFunc = CheckerFn<void (ProgramStateRef,SymbolReaper &)> |
Definition at line 529 of file CheckerManager.h.
Definition at line 503 of file CheckerManager.h.
Definition at line 523 of file CheckerManager.h.
Definition at line 494 of file CheckerManager.h.
Definition at line 537 of file CheckerManager.h.
Definition at line 531 of file CheckerManager.h.
| using clang::ento::CheckerManager::CheckStmtFunc = CheckerFn<void (const Stmt *, CheckerContext &)> |
Definition at line 492 of file CheckerManager.h.
Definition at line 543 of file CheckerManager.h.
| using clang::ento::CheckerManager::EvalCallFunc = CheckerFn<bool (const CallEvent &, CheckerContext &)> |
Definition at line 546 of file CheckerManager.h.
| using clang::ento::CheckerManager::EventTag = void * |
Definition at line 604 of file CheckerManager.h.
| using clang::ento::CheckerManager::HandlesDeclFunc = bool (*)(const Decl *D) |
Definition at line 482 of file CheckerManager.h.
| using clang::ento::CheckerManager::HandlesStmtFunc = bool (*)(const Stmt *D) |
Definition at line 552 of file CheckerManager.h.
| 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().
|
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 148 of file CheckerManager.h.
References CheckerManager().
| clang::ento::CheckerManager::CheckerManager | ( | AnalyzerOptions & | AOptions, |
| const LangOptions & | LangOpts, | ||
| DiagnosticsEngine & | Diags, | ||
| 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().
|
default |
|
inline |
Definition at line 620 of file CheckerManager.h.
|
inline |
Definition at line 614 of file CheckerManager.h.
Referenced by clang::ento::EventDispatcher< EVENT >::_register().
| void CheckerManager::_registerForBeginFunction | ( | CheckBeginFunctionFunc | checkfn | ) |
Definition at line 969 of file CheckerManager.cpp.
Referenced by clang::ento::check::BeginFunction::_register().
| void CheckerManager::_registerForBind | ( | CheckBindFunc | checkfn | ) |
Definition at line 957 of file CheckerManager.cpp.
Referenced by clang::ento::check::Bind::_register().
| void CheckerManager::_registerForBlockEntrance | ( | CheckBlockEntranceFunc | checkfn | ) |
Definition at line 961 of file CheckerManager.cpp.
Referenced by clang::ento::check::BlockEntrance::_register().
| void CheckerManager::_registerForBody | ( | CheckDeclFunc | checkfn | ) |
Definition at line 910 of file CheckerManager.cpp.
Referenced by clang::ento::check::ASTCodeBody::_register().
| void CheckerManager::_registerForBranchCondition | ( | CheckBranchConditionFunc | checkfn | ) |
Definition at line 977 of file CheckerManager.cpp.
Referenced by clang::ento::check::BranchCondition::_register().
| void CheckerManager::_registerForConstPointerEscape | ( | CheckPointerEscapeFunc | checkfn | ) |
Definition at line 1002 of file CheckerManager.cpp.
| void CheckerManager::_registerForDeadSymbols | ( | CheckDeadSymbolsFunc | checkfn | ) |
Definition at line 990 of file CheckerManager.cpp.
Referenced by clang::ento::check::DeadSymbols::_register().
| void CheckerManager::_registerForDecl | ( | CheckDeclFunc | checkfn, |
| HandlesDeclFunc | isForDeclFn ) |
Definition at line 904 of file CheckerManager.cpp.
Referenced by clang::ento::check::ASTDecl< DECL >::_register().
| void CheckerManager::_registerForEndAnalysis | ( | CheckEndAnalysisFunc | checkfn | ) |
Definition at line 965 of file CheckerManager.cpp.
Referenced by clang::ento::check::EndAnalysis::_register().
| void CheckerManager::_registerForEndFunction | ( | CheckEndFunctionFunc | checkfn | ) |
Definition at line 973 of file CheckerManager.cpp.
Referenced by clang::ento::check::EndFunction::_register().
| void CheckerManager::_registerForEndOfTranslationUnit | ( | CheckEndOfTranslationUnit | checkfn | ) |
Definition at line 1015 of file CheckerManager.cpp.
Referenced by clang::ento::check::EndOfTranslationUnit::_register().
| void CheckerManager::_registerForEvalAssume | ( | EvalAssumeFunc | checkfn | ) |
Definition at line 1007 of file CheckerManager.cpp.
Referenced by clang::ento::eval::Assume::_register().
| void CheckerManager::_registerForEvalCall | ( | EvalCallFunc | checkfn | ) |
Definition at line 1011 of file CheckerManager.cpp.
Referenced by clang::ento::eval::Call::_register().
| void CheckerManager::_registerForLifetimeEnd | ( | CheckLifetimeEndFunc | checkfn | ) |
Definition at line 949 of file CheckerManager.cpp.
Referenced by clang::ento::check::LifetimeEnd::_register().
| void CheckerManager::_registerForLiveSymbols | ( | CheckLiveSymbolsFunc | checkfn | ) |
Definition at line 986 of file CheckerManager.cpp.
Referenced by clang::ento::check::LiveSymbols::_register().
| void CheckerManager::_registerForLocation | ( | CheckLocationFunc | checkfn | ) |
Definition at line 953 of file CheckerManager.cpp.
Referenced by clang::ento::check::Location::_register().
| void CheckerManager::_registerForNewAllocator | ( | CheckNewAllocatorFunc | checkfn | ) |
Definition at line 982 of file CheckerManager.cpp.
Referenced by clang::ento::check::NewAllocator::_register().
| void CheckerManager::_registerForObjCMessageNil | ( | CheckObjCMessageFunc | checkfn | ) |
Definition at line 934 of file CheckerManager.cpp.
Referenced by clang::ento::check::ObjCMessageNil::_register().
| void CheckerManager::_registerForPointerEscape | ( | CheckPointerEscapeFunc | checkfn | ) |
Definition at line 998 of file CheckerManager.cpp.
Referenced by clang::ento::check::ConstPointerEscape::_register(), and clang::ento::check::PointerEscape::_register().
| void CheckerManager::_registerForPostCall | ( | CheckCallFunc | checkfn | ) |
Definition at line 945 of file CheckerManager.cpp.
Referenced by clang::ento::check::PostCall::_register().
| void CheckerManager::_registerForPostObjCMessage | ( | CheckObjCMessageFunc | checkfn | ) |
Definition at line 938 of file CheckerManager.cpp.
Referenced by clang::ento::check::PostObjCMessage::_register().
| void CheckerManager::_registerForPostStmt | ( | CheckStmtFunc | checkfn, |
| HandlesStmtFunc | isForStmtFn ) |
Definition at line 924 of file CheckerManager.cpp.
Referenced by clang::ento::check::PostStmt< STMT >::_register().
| void CheckerManager::_registerForPreCall | ( | CheckCallFunc | checkfn | ) |
Definition at line 942 of file CheckerManager.cpp.
Referenced by clang::ento::check::PreCall::_register().
| void CheckerManager::_registerForPreObjCMessage | ( | CheckObjCMessageFunc | checkfn | ) |
Definition at line 930 of file CheckerManager.cpp.
Referenced by clang::ento::check::PreObjCMessage::_register().
| void CheckerManager::_registerForPreStmt | ( | CheckStmtFunc | checkfn, |
| HandlesStmtFunc | isForStmtFn ) |
Definition at line 918 of file CheckerManager.cpp.
Referenced by clang::ento::check::PreStmt< STMT >::_register().
| void CheckerManager::_registerForRegionChanges | ( | CheckRegionChangesFunc | checkfn | ) |
Definition at line 994 of file CheckerManager.cpp.
Referenced by clang::ento::check::RegionChanges::_register().
|
inline |
Definition at line 608 of file CheckerManager.h.
Referenced by clang::ento::check::Event< EVENT >::_register().
|
inline |
Definition at line 166 of file CheckerManager.h.
|
inline |
Definition at line 175 of file CheckerManager.h.
Referenced by clang::ento::getConfiguration().
|
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 197 of file CheckerManager.h.
References CHECKER.
Referenced by REGISTER_MAP_WITH_PROGRAMSTATE(), registerChecker(), and clang::ento::registerInnerPointerCheckerAux().
|
inline |
Definition at line 171 of file CheckerManager.h.
|
inline |
Definition at line 161 of file CheckerManager.h.
Referenced by clang::ento::CheckerFrontend::enable().
|
inline |
Definition at line 174 of file CheckerManager.h.
Referenced by CheckerManager(), and reportInvalidCheckerOptionValue().
|
inline |
Definition at line 165 of file CheckerManager.h.
Referenced by CheckerManager().
|
inline |
Definition at line 167 of file CheckerManager.h.
| bool CheckerManager::hasPathSensitiveCheckers | ( | ) | const |
Definition at line 37 of file CheckerManager.cpp.
Definition at line 222 of file CheckerManager.h.
|
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 216 of file CheckerManager.h.
References CHECKER, and getChecker().
Referenced by clang::ento::registerCheckerDocumentationChecker().
| 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 52 of file CheckerManager.cpp.
References getDiagnostics(), clang::ento::CheckerFrontend::getName(), and clang::DiagnosticsEngine::Report().
Referenced by clang::ento::getConfiguration(), and REGISTER_MAP_WITH_PROGRAMSTATE().
| void CheckerManager::runCheckersForBeginFunction | ( | ExplodedNodeSet & | Dst, |
| const BlockEdge & | L, | ||
| ExplodedNode * | Pred, | ||
| ExprEngine & | Eng ) |
Run checkers on beginning of function.
Definition at line 528 of file CheckerManager.cpp.
References clang::C, expandGraphWithCheckers(), and clang::ento::ExplodedNodeSet::insert().
Referenced by clang::ento::ExprEngine::processBeginOfFunction().
| 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 445 of file CheckerManager.cpp.
References clang::C, and expandGraphWithCheckers().
| 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 484 of file CheckerManager.cpp.
References clang::C, and expandGraphWithCheckers().
Referenced by clang::ento::ExprEngine::runCheckersForBlockEntrance().
| void CheckerManager::runCheckersForBranchCondition | ( | const Stmt * | condition, |
| ExplodedNodeSet & | Dst, | ||
| ExplodedNode * | Pred, | ||
| ExprEngine & | Eng ) |
Run checkers for branch condition.
Definition at line 603 of file CheckerManager.cpp.
References clang::C, clang::Condition, expandGraphWithCheckers(), and clang::ento::ExplodedNodeSet::insert().
Referenced by clang::ento::ExprEngine::processBranch(), and clang::ento::ExprEngine::processSwitch().
| void CheckerManager::runCheckersForCallEvent | ( | bool | isPreVisit, |
| ExplodedNodeSet & | Dst, | ||
| const ExplodedNodeSet & | Src, | ||
| const CallEvent & | Call, | ||
| ExprEngine & | Eng, | ||
| bool | wasInlined = false ) |
Run checkers for visiting function calls (including methods, constructors, destructors etc.
Run checkers for visiting an abstract call event.
but excluding obj-c messages).
Definition at line 297 of file CheckerManager.cpp.
References clang::C, clang::Call, and expandGraphWithCheckers().
Referenced by runCheckersForPostCall(), and runCheckersForPreCall().
| void CheckerManager::runCheckersForDeadSymbols | ( | ExplodedNodeSet & | Dst, |
| const ExplodedNodeSet & | Src, | ||
| SymbolReaper & | SymReaper, | ||
| const Stmt * | S, | ||
| ExprEngine & | Eng, | ||
| ProgramPoint::Kind | K ) |
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 703 of file CheckerManager.cpp.
References clang::C, and expandGraphWithCheckers().
Referenced by clang::ento::ExprEngine::removeDead().
| void CheckerManager::runCheckersForEndAnalysis | ( | ExplodedGraph & | G, |
| BugReporter & | BR, | ||
| ExprEngine & | Eng ) |
Run checkers for end of analysis.
Definition at line 493 of file CheckerManager.cpp.
Referenced by clang::ento::ExprEngine::processEndWorklist().
| void CheckerManager::runCheckersForEndFunction | ( | ExplodedNodeSet & | Dst, |
| ExplodedNode * | Pred, | ||
| ExprEngine & | Eng, | ||
| const ReturnStmt * | RS ) |
Run checkers on end of function.
Run checkers for end of a function (either the entrypoint or another function that was inlined).
Note that this function places the checker activations on separate execution paths: /-[checker1]-> N1 ... Pred –[checker2]-> N2 ... -[checker3]-> N3 ... (If none of the checkers produce a transition, we continue with 'Pred'.)
This differs from the handling of all the other checker callbacks, where the checker activations are chained sequentially on a single path: Pred –[checker1]-> N1 –[checker2]-> N2 –[checker3]-> N3 ...
This difference has historical reasons: originally this callback was called 'EndPath' and only activated at the end of an execution paths, and (according to an old comment) those 'EndPath' checkers expected that they create an "end of path" node which will be final. TODO: Check whether this exceptional behavior is still justified.
Definition at line 556 of file CheckerManager.cpp.
References clang::C, clang::ento::ExplodedNode::getStackFrame(), and clang::ento::ExplodedNodeSet::insert().
Referenced by clang::ento::ExprEngine::processEndOfFunction().
| ProgramStateRef CheckerManager::runCheckersForEvalAssume | ( | ProgramStateRef | state, |
| SVal | Cond, | ||
| bool | Assumption ) |
Run checkers for handling assumptions on symbolic values.
Definition at line 754 of file CheckerManager.cpp.
Referenced by clang::ento::ExprEngine::processAssume().
| 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 768 of file CheckerManager.cpp.
References clang::C, clang::Call, clang::ento::ExprEngine::defaultEvalCall(), clang::ProgramPoint::getProgramPoint(), clang::ento::ExplodedNode::getStackFrame(), clang::ento::ExplodedNode::getState(), clang::ento::ExplodedNodeSet::insert(), clang::ento::OS, clang::ProgramPoint::PostStmtKind, and toString().
Referenced by clang::ento::ExprEngine::evalCall().
| void CheckerManager::runCheckersForLifetimeEnd | ( | ExplodedNodeSet & | Dst, |
| const ExplodedNodeSet & | Src, | ||
| const VarDecl * | Decl, | ||
| ExprEngine & | Eng ) |
Run checkers for the end of a variable's lifetime.
Run checkers for end of variable lifetime.
Definition at line 341 of file CheckerManager.cpp.
References clang::C, and expandGraphWithCheckers().
Referenced by clang::ento::ExprEngine::ProcessLifetimeEnd().
| 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 660 of file CheckerManager.cpp.
Referenced by clang::ento::ExprEngine::removeDead().
| 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 388 of file CheckerManager.cpp.
References clang::C, and expandGraphWithCheckers().
| void CheckerManager::runCheckersForNewAllocator | ( | const CXXAllocatorCall & | Call, |
| ExplodedNodeSet & | Dst, | ||
| ExplodedNode * | Pred, | ||
| ExprEngine & | Eng, | ||
| bool | wasInlined = false ) |
Run checkers between C++ operator new and constructor calls.
Definition at line 647 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().
| void CheckerManager::runCheckersForObjCMessage | ( | ObjCMessageVisitKind | visitKind, |
| ExplodedNodeSet & | Dst, | ||
| const ExplodedNodeSet & | Src, | ||
| const ObjCMethodCall & | msg, | ||
| ExprEngine & | Eng, | ||
| bool | wasInlined = false ) |
Run checkers for visiting obj-c messages.
Definition at line 237 of file CheckerManager.cpp.
References clang::C, and expandGraphWithCheckers().
Referenced by runCheckersForObjCMessageNil(), runCheckersForPostObjCMessage(), and runCheckersForPreObjCMessage().
|
inline |
Run checkers for visiting an obj-c message to nil.
Definition at line 294 of file CheckerManager.h.
References clang::ento::MessageNil, and runCheckersForObjCMessage().
Referenced by clang::ento::ExprEngine::VisitObjCMessage().
| ProgramStateRef CheckerManager::runCheckersForPointerEscape | ( | ProgramStateRef | State, |
| const InvalidatedSymbols & | Escaped, | ||
| const CallEvent * | Call, | ||
| PointerEscapeKind | Kind, | ||
| RegionAndSymbolInvalidationTraits * | ITraits ) |
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.
| 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. |
Definition at line 733 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().
|
inline |
Run checkers for post-visiting function calls (including methods, constructors, destructors etc.
but excluding 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().
|
inline |
Run checkers for post-visiting obj-c messages.
Definition at line 284 of file CheckerManager.h.
References clang::ento::Post, and runCheckersForObjCMessage().
Referenced by clang::ento::ExprEngine::processCallExit(), and clang::ento::ExprEngine::VisitObjCMessage().
|
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.
Definition at line 261 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().
|
inline |
Run checkers for pre-visiting function calls (including methods, constructors, destructors etc.
but excluding obj-c messages).
Definition at line 311 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().
|
inline |
Run checkers for pre-visiting obj-c messages.
Definition at line 276 of file CheckerManager.h.
References clang::ento::Pre, and runCheckersForObjCMessage().
Referenced by clang::ento::ExprEngine::VisitObjCMessage().
|
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.
Definition at line 248 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().
| void CheckerManager::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.
Unlike most other callbacks, any checker can simply implement the virtual method CheckerBackend::printState if it has custom data to print.
| 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 832 of file CheckerManager.cpp.
References clang::Indent().
Referenced by clang::ento::ExprEngine::printJson().
| ProgramStateRef CheckerManager::runCheckersForRegionChanges | ( | ProgramStateRef | state, |
| const InvalidatedSymbols * | invalidated, | ||
| ArrayRef< const MemRegion * > | ExplicitRegions, | ||
| ArrayRef< const MemRegion * > | Regions, | ||
| const StackFrame * | SF, | ||
| const CallEvent * | Call ) |
Run checkers for region changes.
This corresponds to the check::RegionChanges callback.
| 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 715 of file CheckerManager.cpp.
References clang::Call.
Referenced by clang::ento::ExprEngine::processRegionChanges().
| void CheckerManager::runCheckersForStmt | ( | bool | isPreVisit, |
| ExplodedNodeSet & | Dst, | ||
| const ExplodedNodeSet & | Src, | ||
| const Stmt * | S, | ||
| ExprEngine & | Eng, | ||
| bool | wasInlined = false ) |
Run checkers for visiting Stmts.
Definition at line 176 of file CheckerManager.cpp.
References clang::C, and expandGraphWithCheckers().
Referenced by runCheckersForPostStmt(), and runCheckersForPreStmt().
| void CheckerManager::runCheckersOnASTBody | ( | const Decl * | D, |
| AnalysisManager & | mgr, | ||
| BugReporter & | BR ) |
Run checkers handling Decls containing a Stmt body.
Definition at line 84 of file CheckerManager.cpp.
References clang::Decl::hasBody().
| void CheckerManager::runCheckersOnASTDecl | ( | const Decl * | D, |
| AnalysisManager & | mgr, | ||
| BugReporter & | BR ) |
Run checkers handling Decls.
Definition at line 65 of file CheckerManager.cpp.
References clang::Decl::getKind().
| void CheckerManager::runCheckersOnEndOfTranslationUnit | ( | const TranslationUnitDecl * | TU, |
| AnalysisManager & | mgr, | ||
| BugReporter & | BR ) |
Run checkers for the entire Translation Unit.
Definition at line 824 of file CheckerManager.cpp.
|
inline |
Definition at line 160 of file CheckerManager.h.
Referenced by clang::ento::CheckerRegistry::initializeManager().