clang 19.0.0git
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
clang::ento::retaincountchecker::RetainCountChecker Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h"

Inheritance diagram for clang::ento::retaincountchecker::RetainCountChecker:
Inheritance graph
[legend]

Public Member Functions

 RetainCountChecker ()
 
RetainSummaryManagergetSummaryManager (ASTContext &Ctx) const
 
RetainSummaryManagergetSummaryManager (CheckerContext &C) const
 
void printState (raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) const override
 See CheckerManager::runCheckersForPrintState.
 
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
 
- Public Member Functions inherited from clang::ento::CheckerBase
StringRef getTagDescription () const override
 
CheckerNameRef getCheckerName () const
 
virtual void printState (raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) const
 See CheckerManager::runCheckersForPrintState.
 
- Public Member Functions inherited from clang::ProgramPointTag
 ProgramPointTag (void *tagKind=nullptr)
 
virtual ~ProgramPointTag ()
 
virtual StringRef getTagDescription () const =0
 
const void * getTagKind () const
 Used to implement 'isKind' in subclasses.
 

Static Public Member Functions

static const CheckerProgramPointTaggetDeallocSentTag ()
 
static const CheckerProgramPointTaggetCastFailTag ()
 
- 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)
 

Public Attributes

std::unique_ptr< RefCountBugUseAfterRelease
 
std::unique_ptr< RefCountBugReleaseNotOwned
 
std::unique_ptr< RefCountBugDeallocNotOwned
 
std::unique_ptr< RefCountBugFreeNotOwned
 
std::unique_ptr< RefCountBugOverAutorelease
 
std::unique_ptr< RefCountBugReturnNotOwnedForOwned
 
std::unique_ptr< RefCountBugLeakWithinFunction
 
std::unique_ptr< RefCountBugLeakAtReturn
 
std::unique_ptr< RetainSummaryManagerSummaries
 
bool TrackObjCAndCFObjects = false
 Track Objective-C and CoreFoundation objects.
 
bool TrackOSObjects = false
 Track sublcasses of OSObject.
 
bool TrackNSCFStartParam = false
 Track initial parameters (for the entry point) for NS/CF objects.
 

Static Public Attributes

static std::unique_ptr< CheckerProgramPointTagDeallocSentTag
 
static std::unique_ptr< CheckerProgramPointTagCastFailTag
 

Detailed Description

Definition at line 237 of file RetainCountChecker.h.

Constructor & Destructor Documentation

◆ RetainCountChecker()

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

Definition at line 277 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 258 of file RetainCountChecker.cpp.

References clang::C, and processObjCLiterals().

◆ checkPostStmt() [4/6]

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

◆ checkPostStmt() [5/6]

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

Definition at line 264 of file RetainCountChecker.cpp.

References clang::C, and processObjCLiterals().

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

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

◆ getDeallocSentTag()

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

◆ getSummaryManager() [1/2]

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

◆ getSummaryManager() [2/2]

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

Definition at line 286 of file RetainCountChecker.h.

References clang::C, and getSummaryManager().

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

See CheckerManager::runCheckersForPrintState.

Reimplemented from clang::ento::CheckerBase.

Definition at line 1455 of file RetainCountChecker.cpp.

◆ 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

Member Data Documentation

◆ CastFailTag

std::unique_ptr< CheckerProgramPointTag > RetainCountChecker::CastFailTag
static

Definition at line 266 of file RetainCountChecker.h.

Referenced by getCastFailTag().

◆ DeallocNotOwned

std::unique_ptr<RefCountBug> clang::ento::retaincountchecker::RetainCountChecker::DeallocNotOwned

Definition at line 256 of file RetainCountChecker.h.

Referenced by errorKindToBugKind().

◆ DeallocSentTag

std::unique_ptr< CheckerProgramPointTag > RetainCountChecker::DeallocSentTag
static

Definition at line 265 of file RetainCountChecker.h.

Referenced by getDeallocSentTag().

◆ FreeNotOwned

std::unique_ptr<RefCountBug> clang::ento::retaincountchecker::RetainCountChecker::FreeNotOwned

Definition at line 257 of file RetainCountChecker.h.

Referenced by errorKindToBugKind().

◆ LeakAtReturn

std::unique_ptr<RefCountBug> clang::ento::retaincountchecker::RetainCountChecker::LeakAtReturn

Definition at line 261 of file RetainCountChecker.h.

Referenced by checkReturnWithRetEffect(), and processLeaks().

◆ LeakWithinFunction

std::unique_ptr<RefCountBug> clang::ento::retaincountchecker::RetainCountChecker::LeakWithinFunction

Definition at line 260 of file RetainCountChecker.h.

Referenced by processLeaks().

◆ OverAutorelease

std::unique_ptr<RefCountBug> clang::ento::retaincountchecker::RetainCountChecker::OverAutorelease

Definition at line 258 of file RetainCountChecker.h.

Referenced by handleAutoreleaseCounts().

◆ ReleaseNotOwned

std::unique_ptr<RefCountBug> clang::ento::retaincountchecker::RetainCountChecker::ReleaseNotOwned

Definition at line 255 of file RetainCountChecker.h.

Referenced by errorKindToBugKind().

◆ ReturnNotOwnedForOwned

std::unique_ptr<RefCountBug> clang::ento::retaincountchecker::RetainCountChecker::ReturnNotOwnedForOwned

Definition at line 259 of file RetainCountChecker.h.

Referenced by checkReturnWithRetEffect().

◆ Summaries

std::unique_ptr<RetainSummaryManager> clang::ento::retaincountchecker::RetainCountChecker::Summaries
mutable

Definition at line 263 of file RetainCountChecker.h.

Referenced by checkPostCall(), and getSummaryManager().

◆ TrackNSCFStartParam

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

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

Definition at line 275 of file RetainCountChecker.h.

Referenced by checkBeginFunction().

◆ TrackObjCAndCFObjects

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

Track Objective-C and CoreFoundation objects.

Definition at line 269 of file RetainCountChecker.h.

Referenced by getSummaryManager().

◆ TrackOSObjects

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

Track sublcasses of OSObject.

Definition at line 272 of file RetainCountChecker.h.

Referenced by getSummaryManager().

◆ UseAfterRelease

std::unique_ptr<RefCountBug> clang::ento::retaincountchecker::RetainCountChecker::UseAfterRelease

Definition at line 254 of file RetainCountChecker.h.

Referenced by errorKindToBugKind().


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