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

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

Public Types

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)>
 

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
 
void finishedCheckerRegistration ()
 
const LangOptionsgetLangOpts () const
 
const AnalyzerOptionsgetAnalyzerOptions () const
 
const PreprocessorgetPreprocessor () const
 
const CheckerRegistryDatagetCheckerRegistryData () const
 
DiagnosticsEnginegetDiagnostics () const
 
ASTContextgetASTContext () 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>
CHECKERregisterChecker (AT &&... Args)
 Used to register checkers.
 
template<typename CHECKER >
CHECKERgetChecker ()
 
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
 

Detailed Description

Definition at line 126 of file CheckerManager.h.

Member Typedef Documentation

◆ CheckBeginFunctionFunc

Definition at line 500 of file CheckerManager.h.

◆ CheckBindFunc

Definition at line 494 of file CheckerManager.h.

◆ CheckBranchConditionFunc

Definition at line 505 of file CheckerManager.h.

◆ CheckCallFunc

Definition at line 488 of file CheckerManager.h.

◆ CheckDeadSymbolsFunc

Definition at line 511 of file CheckerManager.h.

◆ CheckDeclFunc

Definition at line 470 of file CheckerManager.h.

◆ CheckEndAnalysisFunc

Definition at line 497 of file CheckerManager.h.

◆ CheckEndFunctionFunc

Definition at line 502 of file CheckerManager.h.

◆ CheckEndOfTranslationUnit

Definition at line 535 of file CheckerManager.h.

◆ CheckerDtor

Definition at line 192 of file CheckerManager.h.

◆ CheckerRef

Definition at line 190 of file CheckerManager.h.

◆ CheckerTag

Definition at line 191 of file CheckerManager.h.

◆ CheckEventFunc

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

Definition at line 588 of file CheckerManager.h.

◆ CheckLiveSymbolsFunc

Definition at line 514 of file CheckerManager.h.

◆ CheckLocationFunc

Definition at line 491 of file CheckerManager.h.

◆ CheckNewAllocatorFunc

Definition at line 508 of file CheckerManager.h.

◆ CheckObjCMessageFunc

Definition at line 485 of file CheckerManager.h.

◆ CheckPointerEscapeFunc

Definition at line 524 of file CheckerManager.h.

◆ CheckRegionChangesFunc

Definition at line 516 of file CheckerManager.h.

◆ CheckStmtFunc

Definition at line 483 of file CheckerManager.h.

◆ EvalAssumeFunc

Definition at line 530 of file CheckerManager.h.

◆ EvalCallFunc

Definition at line 533 of file CheckerManager.h.

◆ EventTag

Definition at line 587 of file CheckerManager.h.

◆ HandlesDeclFunc

Definition at line 473 of file CheckerManager.h.

◆ HandlesStmtFunc

Definition at line 539 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 
)

◆ 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.

◆ CheckerManager() [3/3]

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 34 of file CreateCheckerManager.cpp.

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

◆ ~CheckerManager()

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

Definition at line 44 of file CreateCheckerManager.cpp.

Member Function Documentation

◆ _dispatchEvent()

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

◆ _registerDispatcherForEvent()

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

Definition at line 597 of file CheckerManager.h.

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

◆ _registerForBeginFunction()

void CheckerManager::_registerForBeginFunction ( CheckBeginFunctionFunc  checkfn)

Definition at line 850 of file CheckerManager.cpp.

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

◆ _registerForBind()

void CheckerManager::_registerForBind ( CheckBindFunc  checkfn)

Definition at line 842 of file CheckerManager.cpp.

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

◆ _registerForBody()

void CheckerManager::_registerForBody ( CheckDeclFunc  checkfn)

Definition at line 799 of file CheckerManager.cpp.

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

◆ _registerForBranchCondition()

void CheckerManager::_registerForBranchCondition ( CheckBranchConditionFunc  checkfn)

Definition at line 858 of file CheckerManager.cpp.

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

◆ _registerForConstPointerEscape()

void CheckerManager::_registerForConstPointerEscape ( CheckPointerEscapeFunc  checkfn)

Definition at line 883 of file CheckerManager.cpp.

◆ _registerForDeadSymbols()

void CheckerManager::_registerForDeadSymbols ( CheckDeadSymbolsFunc  checkfn)

Definition at line 871 of file CheckerManager.cpp.

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

◆ _registerForDecl()

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

Definition at line 793 of file CheckerManager.cpp.

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

◆ _registerForEndAnalysis()

void CheckerManager::_registerForEndAnalysis ( CheckEndAnalysisFunc  checkfn)

Definition at line 846 of file CheckerManager.cpp.

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

◆ _registerForEndFunction()

void CheckerManager::_registerForEndFunction ( CheckEndFunctionFunc  checkfn)

Definition at line 854 of file CheckerManager.cpp.

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

◆ _registerForEndOfTranslationUnit()

void CheckerManager::_registerForEndOfTranslationUnit ( CheckEndOfTranslationUnit  checkfn)

◆ _registerForEvalAssume()

void CheckerManager::_registerForEvalAssume ( EvalAssumeFunc  checkfn)

Definition at line 888 of file CheckerManager.cpp.

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

◆ _registerForEvalCall()

void CheckerManager::_registerForEvalCall ( EvalCallFunc  checkfn)

Definition at line 892 of file CheckerManager.cpp.

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

◆ _registerForLiveSymbols()

void CheckerManager::_registerForLiveSymbols ( CheckLiveSymbolsFunc  checkfn)

Definition at line 867 of file CheckerManager.cpp.

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

◆ _registerForLocation()

void CheckerManager::_registerForLocation ( CheckLocationFunc  checkfn)

Definition at line 838 of file CheckerManager.cpp.

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

◆ _registerForNewAllocator()

void CheckerManager::_registerForNewAllocator ( CheckNewAllocatorFunc  checkfn)

Definition at line 863 of file CheckerManager.cpp.

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

◆ _registerForObjCMessageNil()

void CheckerManager::_registerForObjCMessageNil ( CheckObjCMessageFunc  checkfn)

Definition at line 823 of file CheckerManager.cpp.

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

◆ _registerForPointerEscape()

void CheckerManager::_registerForPointerEscape ( CheckPointerEscapeFunc  checkfn)

◆ _registerForPostCall()

void CheckerManager::_registerForPostCall ( CheckCallFunc  checkfn)

Definition at line 834 of file CheckerManager.cpp.

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

◆ _registerForPostObjCMessage()

void CheckerManager::_registerForPostObjCMessage ( CheckObjCMessageFunc  checkfn)

Definition at line 827 of file CheckerManager.cpp.

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

◆ _registerForPostStmt()

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

Definition at line 813 of file CheckerManager.cpp.

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

◆ _registerForPreCall()

void CheckerManager::_registerForPreCall ( CheckCallFunc  checkfn)

Definition at line 831 of file CheckerManager.cpp.

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

◆ _registerForPreObjCMessage()

void CheckerManager::_registerForPreObjCMessage ( CheckObjCMessageFunc  checkfn)

Definition at line 819 of file CheckerManager.cpp.

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

◆ _registerForPreStmt()

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

Definition at line 807 of file CheckerManager.cpp.

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

◆ _registerForRegionChanges()

void CheckerManager::_registerForRegionChanges ( CheckRegionChangesFunc  checkfn)

Definition at line 875 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 591 of file CheckerManager.h.

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

◆ finishedCheckerRegistration()

void CheckerManager::finishedCheckerRegistration ( )

Definition at line 51 of file CheckerManager.cpp.

Referenced by CheckerManager().

◆ getAnalyzerOptions()

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

Definition at line 170 of file CheckerManager.h.

◆ getASTContext()

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

Definition at line 179 of file CheckerManager.h.

◆ getChecker()

template<typename CHECKER >
CHECKER * clang::ento::CheckerManager::getChecker ( )
inline

Definition at line 218 of file CheckerManager.h.

References CHECKER.

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

◆ getCheckerRegistryData()

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

Definition at line 175 of file CheckerManager.h.

◆ getCurrentCheckerName()

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

Definition at line 163 of file CheckerManager.h.

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

◆ getDiagnostics()

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

Definition at line 178 of file CheckerManager.h.

Referenced by reportInvalidCheckerOptionValue().

◆ getLangOpts()

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

Definition at line 169 of file CheckerManager.h.

◆ getPreprocessor()

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

Definition at line 171 of file CheckerManager.h.

◆ hasPathSensitiveCheckers()

bool CheckerManager::hasPathSensitiveCheckers ( ) const

Definition at line 37 of file CheckerManager.cpp.

◆ registerChecker()

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

Used to register checkers.

All arguments are automatically passed through to the checker constructor.

Returns
a pointer to the checker object.

Definition at line 204 of file CheckerManager.h.

References CHECKER.

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

◆ reportInvalidCheckerOptionValue()

void CheckerManager::reportInvalidCheckerOptionValue ( const CheckerBase C,
StringRef  OptionName,
StringRef  ExpectedValueDesc 
) const

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

Definition at line 61 of file CheckerManager.cpp.

References clang::C, getDiagnostics(), and clang::DiagnosticsEngine::Report().

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

◆ runCheckersForBeginFunction()

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

Run checkers on beginning of function.

Definition at line 434 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,
ExprEngine Eng,
const ProgramPoint PP 
)

Run checkers for binding of a value to a location.

Definition at line 391 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

◆ runCheckersForBranchCondition()

void CheckerManager::runCheckersForBranchCondition ( const Stmt condition,
ExplodedNodeSet Dst,
ExplodedNode Pred,
ExprEngine Eng 
)

Run checkers for branch condition.

Definition at line 492 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,
ExplodedNodeSet Dst,
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 296 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,
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 585 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 400 of file CheckerManager.cpp.

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

◆ runCheckersForEndFunction()

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

Run checkers on end of function.

Run checkers for end of path.

Definition at line 447 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 637 of file CheckerManager.cpp.

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 651 of file CheckerManager.cpp.

References clang::C, clang::Call, clang::ento::ExprEngine::defaultEvalCall(), clang::ento::ExprEngine::getBuilderContext(), clang::ProgramPoint::getProgramPoint(), 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 544 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 348 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

◆ runCheckersForNewAllocator()

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 532 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,
ExplodedNodeSet Dst,
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 294 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,
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.

Parameters
StateThe state at the point of escape.
EscapedThe list of escaped symbols.
CallThe corresponding CallEvent, if the symbols escape as parameters to the given call.
KindThe reason of pointer escape.
ITraitsInformation about invalidation for a particular region/symbol.
Returns
Checkers can modify the state by returning a new one.

Definition at line 616 of file CheckerManager.cpp.

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

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

◆ runCheckersForPostCall()

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

◆ 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 284 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

◆ runCheckersForPreCall()

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

◆ 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 276 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

◆ runCheckersForPrintStateJson()

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 CheckerBase::printState if it has custom data to print.

Parameters
OutThe output stream
StateThe state being printed
NLThe preferred representation of a newline.
SpaceThe preferred space between the left side and the message.
IsDotWhether the message will be printed in 'dot' format.

Definition at line 720 of file CheckerManager.cpp.

References NewLine.

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
stateThe current program state.
invalidatedA set of all symbols potentially touched by the change.
ExplicitRegionsThe regions explicitly requested for invalidation. For example, in the case of a function call, these would be arguments.
RegionsThe transitive closure of accessible regions, i.e. all regions that may have been touched by this change.
CallThe call expression wrapper if the regions are invalidated by a call.

Definition at line 597 of file CheckerManager.cpp.

References clang::Call.

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

◆ runCheckersForStmt()

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 182 of file CheckerManager.cpp.

References clang::C, and expandGraphWithCheckers().

Referenced by runCheckersForPostStmt(), and runCheckersForPreStmt().

◆ runCheckersOnASTBody()

void CheckerManager::runCheckersOnASTBody ( const Decl D,
AnalysisManager mgr,
BugReporter BR 
)

Run checkers handling Decls containing a Stmt body.

Definition at line 96 of file CheckerManager.cpp.

References D, and clang::Decl::hasBody().

◆ runCheckersOnASTDecl()

void CheckerManager::runCheckersOnASTDecl ( const Decl D,
AnalysisManager mgr,
BugReporter BR 
)

Run checkers handling Decls.

Definition at line 74 of file CheckerManager.cpp.

References D, and clang::Decl::getKind().

◆ runCheckersOnEndOfTranslationUnit()

void CheckerManager::runCheckersOnEndOfTranslationUnit ( const TranslationUnitDecl TU,
AnalysisManager mgr,
BugReporter BR 
)

Run checkers for the entire Translation Unit.

Definition at line 712 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: