clang
8.0.0
|
Metadata on reference. More...
Public Types | |
enum | Kind { Owned = 0, NotOwned, Released, ReturnedOwned, ReturnedNotOwned, ERROR_START, ErrorDeallocNotOwned, ErrorUseAfterRelease, ErrorReleaseNotOwned, ERROR_LEAK_START, ErrorLeak, ErrorLeakReturned, ErrorOverAutorelease, ErrorReturnedNotOwned } |
enum | IvarAccessHistory { IvarAccessHistory::None, IvarAccessHistory::AccessedDirectly, IvarAccessHistory::ReleasedAfterDirectAccess } |
Tracks how an object referenced by an ivar has been used. More... | |
Public Member Functions | |
Kind | getKind () const |
ObjKind | getObjKind () const |
unsigned | getCount () const |
unsigned | getAutoreleaseCount () const |
unsigned | getCombinedCounts () const |
void | clearCounts () |
void | setCount (unsigned i) |
void | setAutoreleaseCount (unsigned i) |
QualType | getType () const |
IvarAccessHistory | getIvarAccessHistory () const |
Returns what the analyzer knows about direct accesses to a particular instance variable. More... | |
bool | isOwned () const |
bool | isNotOwned () const |
bool | isReturnedOwned () const |
bool | isReturnedNotOwned () const |
RefVal | operator- (size_t i) const |
RefVal | operator+ (size_t i) const |
RefVal | operator^ (Kind k) const |
RefVal | autorelease () const |
RefVal | withIvarAccess () const |
RefVal | releaseViaIvar () const |
bool | hasSameState (const RefVal &X) const |
bool | operator== (const RefVal &X) const |
void | Profile (llvm::FoldingSetNodeID &ID) const |
void | print (raw_ostream &Out) const |
Static Public Member Functions | |
static RefVal | makeOwned (ObjKind o, QualType t) |
Create a state for an object whose lifetime is the responsibility of the current function, at least partially. More... | |
static RefVal | makeNotOwned (ObjKind o, QualType t) |
Create a state for an object whose lifetime is not the responsibility of the current function. More... | |
Metadata on reference.
Definition at line 52 of file RetainCountChecker.h.
Tracks how an object referenced by an ivar has been used.
This accounts for us not knowing if an arbitrary ivar is supposed to be stored at +0 or +1.
Enumerator | |
---|---|
None | |
AccessedDirectly | |
ReleasedAfterDirectAccess |
Definition at line 76 of file RetainCountChecker.h.
Definition at line 54 of file RetainCountChecker.h.
|
inline |
Definition at line 200 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
Referenced by clang::ento::retaincountchecker::RetainCountChecker::updateSymbol().
|
inline |
Definition at line 131 of file RetainCountChecker.h.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts(), and clang::ento::retaincountchecker::RetainCountChecker::updateSymbol().
|
inline |
Definition at line 129 of file RetainCountChecker.h.
Referenced by autorelease(), clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts(), operator+(), operator-(), operator^(), releaseViaIvar(), and withIvarAccess().
|
inline |
Definition at line 130 of file RetainCountChecker.h.
|
inline |
Definition at line 128 of file RetainCountChecker.h.
Referenced by autorelease(), clang::ento::retaincountchecker::RetainCountChecker::checkReturnWithRetEffect(), clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts(), clang::ento::retaincountchecker::RetainCountChecker::handleSymbolDeath(), operator+(), operator-(), operator^(), releaseViaIvar(), clang::ento::retaincountchecker::RetainCountChecker::updateSymbol(), and withIvarAccess().
|
inline |
Returns what the analyzer knows about direct accesses to a particular instance variable.
If the object with this refcount wasn't originally from an Objective-C ivar region, this should always return IvarAccessHistory::None.
Definition at line 149 of file RetainCountChecker.h.
Referenced by autorelease(), clang::ento::retaincountchecker::RetainCountChecker::checkReturnWithRetEffect(), clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts(), clang::ento::retaincountchecker::RetainCountChecker::handleSymbolDeath(), hasSameState(), operator+(), operator-(), operator^(), releaseViaIvar(), clang::ento::retaincountchecker::RetainCountChecker::updateSymbol(), and withIvarAccess().
|
inline |
Definition at line 122 of file RetainCountChecker.h.
Referenced by autorelease(), clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts(), hasSameState(), isNotOwned(), isOwned(), isReturnedNotOwned(), isReturnedOwned(), operator+(), operator-(), releaseViaIvar(), clang::ento::retaincountchecker::RetainCountChecker::updateSymbol(), and withIvarAccess().
|
inline |
Definition at line 124 of file RetainCountChecker.h.
Referenced by autorelease(), operator+(), operator-(), operator==(), operator^(), releaseViaIvar(), and withIvarAccess().
|
inline |
Definition at line 142 of file RetainCountChecker.h.
Referenced by autorelease(), operator+(), operator-(), operator^(), releaseViaIvar(), and withIvarAccess().
Definition at line 218 of file RetainCountChecker.h.
References getIvarAccessHistory(), and getKind().
Referenced by operator==().
|
inline |
Definition at line 157 of file RetainCountChecker.h.
References getKind(), and NotOwned.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::handleSymbolDeath().
|
inline |
Definition at line 153 of file RetainCountChecker.h.
References getKind(), and Owned.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::handleSymbolDeath().
|
inline |
Definition at line 165 of file RetainCountChecker.h.
References getKind(), and ReturnedNotOwned.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkReturnWithRetEffect().
|
inline |
Definition at line 161 of file RetainCountChecker.h.
References getKind(), and ReturnedOwned.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkReturnWithRetEffect(), and clang::ento::retaincountchecker::RetainCountChecker::handleSymbolDeath().
|
inlinestatic |
Create a state for an object whose lifetime is not the responsibility of the current function.
Most commonly, this is an unowned object with a retain count of +0.
Definition at line 181 of file RetainCountChecker.h.
References None, and NotOwned.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt(), clang::ento::retaincountchecker::RetainCountChecker::processObjCLiterals(), refValFromRetEffect(), and updateOutParameters().
|
inlinestatic |
Create a state for an object whose lifetime is the responsibility of the current function, at least partially.
Most commonly, this is an owned object with a retain count of +1.
Definition at line 173 of file RetainCountChecker.h.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), refValFromRetEffect(), and updateOutParameters().
Definition at line 190 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
Definition at line 185 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
Definition at line 223 of file RetainCountChecker.h.
References getObjKind(), and hasSameState().
Definition at line 195 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getObjKind(), and getType().
void RefVal::print | ( | raw_ostream & | Out | ) | const |
Definition at line 109 of file RetainCountChecker.cpp.
References ErrorOverAutorelease, ErrorReturnedNotOwned, getKind(), clang::None, and clang::CodeGen::state.
Referenced by Profile().
|
inline |
Definition at line 227 of file RetainCountChecker.h.
References print().
|
inline |
Definition at line 211 of file RetainCountChecker.h.
References AccessedDirectly, getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), getType(), and ReleasedAfterDirectAccess.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkReturnWithRetEffect(), clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts(), and clang::ento::retaincountchecker::RetainCountChecker::updateSymbol().
|
inline |
Definition at line 138 of file RetainCountChecker.h.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts().
|
inline |
Definition at line 135 of file RetainCountChecker.h.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::handleAutoreleaseCounts().
|
inline |
Definition at line 205 of file RetainCountChecker.h.
References AccessedDirectly, getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), getType(), and None.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt().