Showing content from https://clang.llvm.org/doxygen/classclang_1_1ento_1_1CheckerManager.html below:
clang: clang::ento::CheckerManager Class Reference
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
using CheckerRef = CheckerBase * using CheckerTag = const void * using CheckerDtor = CheckerFn< void()> using CheckDeclFunc = CheckerFn< void(const Decl *, AnalysisManager &, BugReporter &)> using HandlesDeclFunc = bool(*)(const Decl *D) using CheckStmtFunc = CheckerFn< void(const Stmt *, CheckerContext &)> using CheckObjCMessageFunc = CheckerFn< void(const ObjCMethodCall &, CheckerContext &)> using CheckCallFunc = CheckerFn< void(const CallEvent &, CheckerContext &)> using CheckLocationFunc = CheckerFn< void(SVal location, bool isLoad, const Stmt *S, CheckerContext &)> using CheckBindFunc = CheckerFn< void(SVal location, SVal val, const Stmt *S, CheckerContext &)> using CheckEndAnalysisFunc = CheckerFn< void(ExplodedGraph &, BugReporter &, ExprEngine &)> using CheckBeginFunctionFunc = CheckerFn< void(CheckerContext &)> using CheckEndFunctionFunc = CheckerFn< void(const ReturnStmt *, CheckerContext &)> using CheckBranchConditionFunc = CheckerFn< void(const Stmt *, CheckerContext &)> using CheckNewAllocatorFunc = CheckerFn< void(const CXXAllocatorCall &Call, CheckerContext &)> using CheckDeadSymbolsFunc = CheckerFn< void(SymbolReaper &, CheckerContext &)> using CheckLiveSymbolsFunc = CheckerFn< void(ProgramStateRef, SymbolReaper &)> using CheckRegionChangesFunc = CheckerFn< ProgramStateRef(ProgramStateRef, const InvalidatedSymbols *symbols, ArrayRef< const MemRegion * > ExplicitRegions, ArrayRef< const MemRegion * > Regions, const LocationContext *LCtx, const CallEvent *Call)> using CheckPointerEscapeFunc = CheckerFn< ProgramStateRef(ProgramStateRef, const InvalidatedSymbols &Escaped, const CallEvent *Call, PointerEscapeKind Kind, RegionAndSymbolInvalidationTraits *ITraits)> using EvalAssumeFunc = CheckerFn< ProgramStateRef(ProgramStateRef, SVal cond, bool assumption)> using EvalCallFunc = CheckerFn< bool(const CallEvent &, CheckerContext &)> using CheckEndOfTranslationUnit = CheckerFn< void(const TranslationUnitDecl *, AnalysisManager &, BugReporter &)> using HandlesStmtFunc = bool(*)(const Stmt *D) using EventTag = void * using CheckEventFunc = CheckerFn< void(const void *event)> 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 CheckerBase *C, 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 * registerChecker (AT &&... Args) Used to register checkers.
template<typename CHECKER > CHECKER * getChecker () 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 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, ExprEngine &Eng, const ProgramPoint &PP) Run checkers for binding of a value to a location.
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 (NodeBuilderContext &BC, 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 LocationContext *LCtx, 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 _registerForLocation (CheckLocationFunc checkfn) void _registerForBind (CheckBindFunc 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 126 of file CheckerManager.h.
◆ CheckBeginFunctionFunc ◆ CheckBindFunc ◆ CheckBranchConditionFunc ◆ CheckCallFunc ◆ CheckDeadSymbolsFunc ◆ CheckDeclFunc ◆ CheckEndAnalysisFunc ◆ CheckEndFunctionFunc ◆ CheckEndOfTranslationUnit ◆ CheckerDtor ◆ CheckerRef ◆ CheckerTag ◆ CheckEventFunc ◆ CheckLiveSymbolsFunc ◆ CheckLocationFunc ◆ CheckNewAllocatorFunc ◆ CheckObjCMessageFunc ◆ CheckPointerEscapeFunc ◆ CheckRegionChangesFunc ◆ CheckStmtFunc ◆ EvalAssumeFunc ◆ EvalCallFunc ◆ EventTag ◆ HandlesDeclFunc ◆ HandlesStmtFunc ◆ CheckerManager() [1/3] ◆ CheckerManager() [2/3]
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.
◆ CheckerManager() [3/3] ◆ ~CheckerManager() ◆ _dispatchEvent()
template<typename EVENT >
void clang::ento::CheckerManager::_dispatchEvent ( const EVENT & event ) const inline ◆ _registerDispatcherForEvent()
template<typename EVENT >
void clang::ento::CheckerManager::_registerDispatcherForEvent ( ) inline ◆ _registerForBeginFunction() ◆ _registerForBind() ◆ _registerForBody() ◆ _registerForBranchCondition() ◆ _registerForConstPointerEscape() ◆ _registerForDeadSymbols() ◆ _registerForDecl() ◆ _registerForEndAnalysis() ◆ _registerForEndFunction() ◆ _registerForEndOfTranslationUnit() ◆ _registerForEvalAssume() void CheckerManager::_registerForEvalAssume ( EvalAssumeFunc checkfn ) ◆ _registerForEvalCall() void CheckerManager::_registerForEvalCall ( EvalCallFunc checkfn ) ◆ _registerForLiveSymbols() ◆ _registerForLocation() ◆ _registerForNewAllocator() ◆ _registerForObjCMessageNil() ◆ _registerForPointerEscape() ◆ _registerForPostCall() void CheckerManager::_registerForPostCall ( CheckCallFunc checkfn ) ◆ _registerForPostObjCMessage() ◆ _registerForPostStmt() ◆ _registerForPreCall() void CheckerManager::_registerForPreCall ( CheckCallFunc checkfn ) ◆ _registerForPreObjCMessage() ◆ _registerForPreStmt() ◆ _registerForRegionChanges() ◆ _registerListenerForEvent()
template<typename EVENT >
void clang::ento::CheckerManager::_registerListenerForEvent ( CheckEventFunc checkfn ) inline ◆ getAnalyzerOptions() ◆ getASTContext() ◆ getChecker() CHECKER * clang::ento::CheckerManager::getChecker ( ) inline ◆ getCheckerRegistryData() ◆ getCurrentCheckerName() CheckerNameRef clang::ento::CheckerManager::getCurrentCheckerName ( ) const inline ◆ getDiagnostics() ◆ getLangOpts() ◆ getPreprocessor() ◆ hasPathSensitiveCheckers() ◆ isRegisteredChecker() ◆ registerChecker()
template<typename
CHECKER
, typename... AT>
CHECKER * clang::ento::CheckerManager::registerChecker ( AT &&... Args ) inline ◆ reportInvalidCheckerOptionValue() void CheckerManager::reportInvalidCheckerOptionValue ( const CheckerBase * C, StringRef OptionName, StringRef ExpectedValueDesc ) const ◆ runCheckersForBeginFunction() ◆ runCheckersForBind() ◆ runCheckersForBranchCondition() ◆ runCheckersForCallEvent() ◆ runCheckersForDeadSymbols() ◆ runCheckersForEndAnalysis() ◆ runCheckersForEndFunction() ◆ runCheckersForEvalAssume() ◆ runCheckersForEvalCall() ◆ runCheckersForLiveSymbols() ◆ runCheckersForLocation() ◆ runCheckersForNewAllocator() ◆ runCheckersForObjCMessage() ◆ runCheckersForObjCMessageNil() ◆ runCheckersForPointerEscape()
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 603 of file CheckerManager.cpp.
References clang::Call, clang::ento::PSK_DirectEscapeOnCall, and clang::ento::PSK_IndirectEscapeOnCall.
Referenced by clang::ento::ExprEngine::notifyCheckersOfPointerEscape().
◆ runCheckersForPostCall() ◆ runCheckersForPostObjCMessage() ◆ runCheckersForPostStmt()
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::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() ◆ runCheckersForPreObjCMessage() ◆ runCheckersForPreStmt()
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::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()
Run checkers for debug-printing a ProgramState.
Unlike most other callbacks, any checker can simply implement the virtual method CheckerBase::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 706 of file CheckerManager.cpp.
References NewLine.
Referenced by clang::ento::ExprEngine::printJson().
◆ runCheckersForRegionChanges()
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 584 of file CheckerManager.cpp.
References clang::Call.
Referenced by clang::ento::ExprEngine::processRegionChanges().
◆ runCheckersForStmt() ◆ runCheckersOnASTBody() ◆ runCheckersOnASTDecl() ◆ runCheckersOnEndOfTranslationUnit() ◆ setCurrentCheckerName() void clang::ento::CheckerManager::setCurrentCheckerName ( CheckerNameRef name ) inline
The documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4