clang  10.0.0svn
Public Member Functions | Public Attributes | List of all members
clang::ento::retaincountchecker::RetainCountChecker Class Reference

#include "/opt/doxygen-docs/src/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h"

Inheritance diagram for clang::ento::retaincountchecker::RetainCountChecker:
Inheritance graph
Collaboration diagram for clang::ento::retaincountchecker::RetainCountChecker:
Collaboration graph

Public Member Functions

 RetainCountChecker ()
RetainSummaryManager & getSummaryManager (ASTContext &Ctx) const
RetainSummaryManager & getSummaryManager (CheckerContext &C) const
void printState (raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) const override
 See CheckerManager::runCheckersForPrintState. More...
void checkBind (SVal loc, SVal val, const Stmt *S, CheckerContext &C) const
void checkPostStmt (const BlockExpr *BE, CheckerContext &C) const
void checkPostStmt (const CastExpr *CE, CheckerContext &C) const
void checkPostStmt (const ObjCArrayLiteral *AL, CheckerContext &C) const
void checkPostStmt (const ObjCDictionaryLiteral *DL, CheckerContext &C) const
void checkPostStmt (const ObjCBoxedExpr *BE, CheckerContext &C) const
void checkPostStmt (const ObjCIvarRefExpr *IRE, CheckerContext &C) const
void checkPostCall (const CallEvent &Call, CheckerContext &C) const
void checkSummary (const RetainSummary &Summ, const CallEvent &Call, CheckerContext &C) const
void processSummaryOfInlined (const RetainSummary &Summ, const CallEvent &Call, CheckerContext &C) const
bool evalCall (const CallEvent &Call, CheckerContext &C) const
ProgramStateRef evalAssume (ProgramStateRef state, SVal Cond, bool Assumption) const
ProgramStateRef checkRegionChanges (ProgramStateRef state, const InvalidatedSymbols *invalidated, ArrayRef< const MemRegion *> ExplicitRegions, ArrayRef< const MemRegion *> Regions, const LocationContext *LCtx, const CallEvent *Call) const
ExplodedNodecheckReturnWithRetEffect (const ReturnStmt *S, CheckerContext &C, ExplodedNode *Pred, RetEffect RE, RefVal X, SymbolRef Sym, ProgramStateRef state) const
void checkDeadSymbols (SymbolReaper &SymReaper, CheckerContext &C) const
void checkBeginFunction (CheckerContext &C) const
void checkEndFunction (const ReturnStmt *RS, CheckerContext &C) const
ProgramStateRef updateSymbol (ProgramStateRef state, SymbolRef sym, RefVal V, ArgEffect E, RefVal::Kind &hasErr, CheckerContext &C) const
const RefCountBugerrorKindToBugKind (RefVal::Kind ErrorKind, SymbolRef Sym) const
void processNonLeakError (ProgramStateRef St, SourceRange ErrorRange, RefVal::Kind ErrorKind, SymbolRef Sym, CheckerContext &C) const
void processObjCLiterals (CheckerContext &C, const Expr *Ex) const
ProgramStateRef handleSymbolDeath (ProgramStateRef state, SymbolRef sid, RefVal V, SmallVectorImpl< SymbolRef > &Leaked) const
ProgramStateRef handleAutoreleaseCounts (ProgramStateRef state, ExplodedNode *Pred, const ProgramPointTag *Tag, CheckerContext &Ctx, SymbolRef Sym, RefVal V, const ReturnStmt *S=nullptr) const
ExplodedNodeprocessLeaks (ProgramStateRef state, SmallVectorImpl< SymbolRef > &Leaked, CheckerContext &Ctx, ExplodedNode *Pred=nullptr) const
const CheckerProgramPointTaggetDeallocSentTag () const
const CheckerProgramPointTaggetCastFailTag () const
- Public Member Functions inherited from clang::ento::CheckerBase
StringRef getTagDescription () const override
CheckerNameRef getCheckerName () const
- Public Member Functions inherited from clang::ProgramPointTag
 ProgramPointTag (void *tagKind=nullptr)
virtual ~ProgramPointTag ()
const void * getTagKind () const
 Used to implement 'isKind' in subclasses. More...

Public Attributes

bool TrackObjCAndCFObjects = false
 Track Objective-C and CoreFoundation objects. More...
bool TrackOSObjects = false
 Track sublcasses of OSObject. More...
bool TrackNSCFStartParam = false
 Track initial parameters (for the entry point) for NS/CF objects. More...

Additional Inherited Members

- Static Public Member Functions inherited from clang::ento::Checker< check::Bind, check::DeadSymbols, check::BeginFunction, check::EndFunction, check::PostStmt< BlockExpr >, check::PostStmt< CastExpr >, check::PostStmt< ObjCArrayLiteral >, check::PostStmt< ObjCDictionaryLiteral >, check::PostStmt< ObjCBoxedExpr >, check::PostStmt< ObjCIvarRefExpr >, check::PostCall, check::RegionChanges, eval::Assume, eval::Call >
static void _register (CHECKER *checker, CheckerManager &mgr)
- Static Public Member Functions inherited from clang::ento::check::Bind
template<typename CHECKER >
static void _register (CHECKER *checker, CheckerManager &mgr)

Detailed Description

Definition at line 238 of file RetainCountChecker.h.

Constructor & Destructor Documentation

◆ RetainCountChecker()

clang::ento::retaincountchecker::RetainCountChecker::RetainCountChecker ( )

Definition at line 278 of file RetainCountChecker.h.

Member Function Documentation

◆ checkBeginFunction()

void RetainCountChecker::checkBeginFunction ( CheckerContext C) const

◆ checkBind()

void RetainCountChecker::checkBind ( SVal  loc,
SVal  val,
const Stmt S,
CheckerContext C 
) const

◆ checkDeadSymbols()

void RetainCountChecker::checkDeadSymbols ( SymbolReaper SymReaper,
CheckerContext C 
) const

◆ checkEndFunction()

void RetainCountChecker::checkEndFunction ( const ReturnStmt RS,
CheckerContext C 
) const

◆ checkPostCall()

void RetainCountChecker::checkPostCall ( const CallEvent Call,
CheckerContext C 
) const

◆ checkPostStmt() [1/6]

void RetainCountChecker::checkPostStmt ( const BlockExpr BE,
CheckerContext C 
) const

◆ checkPostStmt() [2/6]

void RetainCountChecker::checkPostStmt ( const CastExpr CE,
CheckerContext C 
) const

◆ checkPostStmt() [3/6]

void RetainCountChecker::checkPostStmt ( const ObjCArrayLiteral AL,
CheckerContext C 
) const

Definition at line 259 of file RetainCountChecker.cpp.

◆ checkPostStmt() [4/6]

void RetainCountChecker::checkPostStmt ( const ObjCDictionaryLiteral DL,
CheckerContext C 
) const

◆ checkPostStmt() [5/6]

void clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt ( const ObjCBoxedExpr BE,
CheckerContext C 
) const

◆ checkPostStmt() [6/6]

void RetainCountChecker::checkPostStmt ( const ObjCIvarRefExpr IRE,
CheckerContext C 
) const

◆ checkRegionChanges()

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

◆ checkReturnWithRetEffect()

ExplodedNode * RetainCountChecker::checkReturnWithRetEffect ( const ReturnStmt S,
CheckerContext C,
ExplodedNode Pred,
RetEffect  RE,
RefVal  X,
SymbolRef  Sym,
ProgramStateRef  state 
) const

◆ checkSummary()

void RetainCountChecker::checkSummary ( const RetainSummary &  Summ,
const CallEvent Call,
CheckerContext C 
) const

◆ errorKindToBugKind()

const RefCountBug & RetainCountChecker::errorKindToBugKind ( RefVal::Kind  ErrorKind,
SymbolRef  Sym 
) const

◆ evalAssume()

ProgramStateRef RetainCountChecker::evalAssume ( ProgramStateRef  state,
SVal  Cond,
bool  Assumption 
) const

◆ evalCall()

bool RetainCountChecker::evalCall ( const CallEvent Call,
CheckerContext C 
) const

◆ getCastFailTag()

const CheckerProgramPointTag& clang::ento::retaincountchecker::RetainCountChecker::getCastFailTag ( ) const

◆ getDeallocSentTag()

const CheckerProgramPointTag& clang::ento::retaincountchecker::RetainCountChecker::getDeallocSentTag ( ) const

Definition at line 363 of file RetainCountChecker.h.

◆ getSummaryManager() [1/2]

RetainSummaryManager& clang::ento::retaincountchecker::RetainCountChecker::getSummaryManager ( ASTContext Ctx) const

Definition at line 280 of file RetainCountChecker.h.

◆ getSummaryManager() [2/2]

RetainSummaryManager& clang::ento::retaincountchecker::RetainCountChecker::getSummaryManager ( CheckerContext C) const

Definition at line 287 of file RetainCountChecker.h.

References clang::ento::CheckerContext::getASTContext(), and State.

◆ handleAutoreleaseCounts()

ProgramStateRef RetainCountChecker::handleAutoreleaseCounts ( ProgramStateRef  state,
ExplodedNode Pred,
const ProgramPointTag Tag,
CheckerContext Ctx,
SymbolRef  Sym,
RefVal  V,
const ReturnStmt S = nullptr 
) const

◆ handleSymbolDeath()

ProgramStateRef RetainCountChecker::handleSymbolDeath ( ProgramStateRef  state,
SymbolRef  sid,
RefVal  V,
SmallVectorImpl< SymbolRef > &  Leaked 
) const

◆ printState()

void RetainCountChecker::printState ( raw_ostream &  Out,
ProgramStateRef  State,
const char *  NL,
const char *  Sep 
) const

See CheckerManager::runCheckersForPrintState.

Reimplemented from clang::ento::CheckerBase.

Definition at line 1455 of file RetainCountChecker.cpp.

References clang::ento::CheckerManager::registerChecker().

◆ processLeaks()

ExplodedNode * RetainCountChecker::processLeaks ( ProgramStateRef  state,
SmallVectorImpl< SymbolRef > &  Leaked,
CheckerContext Ctx,
ExplodedNode Pred = nullptr 
) const

◆ processNonLeakError()

void RetainCountChecker::processNonLeakError ( ProgramStateRef  St,
SourceRange  ErrorRange,
RefVal::Kind  ErrorKind,
SymbolRef  Sym,
CheckerContext C 
) const

◆ processObjCLiterals()

void RetainCountChecker::processObjCLiterals ( CheckerContext C,
const Expr Ex 
) const

◆ processSummaryOfInlined()

void RetainCountChecker::processSummaryOfInlined ( const RetainSummary &  Summ,
const CallEvent Call,
CheckerContext C 
) const

◆ updateSymbol()

ProgramStateRef RetainCountChecker::updateSymbol ( ProgramStateRef  state,
SymbolRef  sym,
RefVal  V,
ArgEffect  E,
RefVal::Kind hasErr,
CheckerContext C 
) const

Definition at line 711 of file RetainCountChecker.cpp.

References clang::ento::retaincountchecker::RefVal::AccessedDirectly, clang::ento::Autorelease, clang::ento::retaincountchecker::RefVal::autorelease(), bool, clang::ento::retaincountchecker::RefVal::clearCounts(), clang::ento::Dealloc, clang::ento::DecRef, clang::ento::DecRefAndStopTrackingHard, clang::ento::DecRefBridgedTransferred, clang::ento::DoNothing, clang::ento::retaincountchecker::RefVal::ErrorDeallocNotOwned, clang::ento::retaincountchecker::RefVal::ErrorReleaseNotOwned, clang::ento::retaincountchecker::RefVal::ErrorUseAfterRelease, clang::ento::CheckerContext::getASTContext(), clang::ento::retaincountchecker::RefVal::getCount(), clang::ento::retaincountchecker::RefVal::getIvarAccessHistory(), clang::ento::retaincountchecker::RefVal::getKind(), clang::ento::ArgEffect::getKind(), clang::ASTContext::getLangOpts(), clang::ento::ArgEffect::getObjKind(), clang::ento::IncRef, clang::ento::MayEscape, clang::ento::retaincountchecker::RefVal::NotOwned, clang::ento::ObjC, clang::ento::retaincountchecker::RefVal::Owned, clang::ento::retaincountchecker::RefVal::Released, clang::ento::retaincountchecker::RefVal::releaseViaIvar(), removeRefBinding(), clang::ento::RetainedOutParameter, clang::ento::RetainedOutParameterOnNonZero, clang::ento::RetainedOutParameterOnZero, setRefBinding(), clang::CodeGen::state, clang::ento::StopTracking, clang::ento::StopTrackingHard, clang::ento::UnretainedOutParameter, and clang::ento::ArgEffect::withKind().

Member Data Documentation

◆ TrackNSCFStartParam

bool clang::ento::retaincountchecker::RetainCountChecker::TrackNSCFStartParam = false

Track initial parameters (for the entry point) for NS/CF objects.

Definition at line 276 of file RetainCountChecker.h.

◆ TrackObjCAndCFObjects

bool clang::ento::retaincountchecker::RetainCountChecker::TrackObjCAndCFObjects = false

Track Objective-C and CoreFoundation objects.

Definition at line 270 of file RetainCountChecker.h.

◆ TrackOSObjects

bool clang::ento::retaincountchecker::RetainCountChecker::TrackOSObjects = false

Track sublcasses of OSObject.

Definition at line 273 of file RetainCountChecker.h.

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