clang 20.0.0git
|
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 class | IvarAccessHistory { None , AccessedDirectly , 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. | |
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. | |
static RefVal | makeNotOwned (ObjKind o, QualType t) |
Create a state for an object whose lifetime is not the responsibility of the current function. | |
Metadata on reference.
Definition at line 50 of file RetainCountChecker.h.
|
strong |
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 74 of file RetainCountChecker.h.
Definition at line 52 of file RetainCountChecker.h.
|
inline |
Definition at line 198 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
|
inline |
Definition at line 129 of file RetainCountChecker.h.
|
inline |
Definition at line 127 of file RetainCountChecker.h.
Referenced by autorelease(), operator+(), operator-(), operator^(), releaseViaIvar(), shouldGenerateNote(), and withIvarAccess().
|
inline |
Definition at line 128 of file RetainCountChecker.h.
Referenced by shouldGenerateNote().
|
inline |
Definition at line 126 of file RetainCountChecker.h.
Referenced by annotateConsumedSummaryMismatch(), annotateStartParameter(), autorelease(), clang::ento::retaincountchecker::RefLeakReportVisitor::getEndPath(), operator+(), operator-(), operator^(), print(), releaseViaIvar(), shouldGenerateNote(), 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 147 of file RetainCountChecker.h.
Referenced by autorelease(), hasSameState(), operator+(), operator-(), operator^(), print(), releaseViaIvar(), shouldGenerateNote(), and withIvarAccess().
|
inline |
Definition at line 120 of file RetainCountChecker.h.
Referenced by autorelease(), clang::ento::retaincountchecker::RefLeakReportVisitor::getEndPath(), hasSameState(), isNotOwned(), isOwned(), isReturnedNotOwned(), isReturnedOwned(), operator+(), operator-(), print(), releaseViaIvar(), shouldGenerateNote(), and withIvarAccess().
|
inline |
Definition at line 122 of file RetainCountChecker.h.
Referenced by autorelease(), generateDiagnosticsForCallLike(), clang::ento::retaincountchecker::RefLeakReportVisitor::getEndPath(), operator+(), operator-(), operator==(), operator^(), releaseViaIvar(), shouldEscapeOSArgumentOnCall(), and withIvarAccess().
|
inline |
Definition at line 140 of file RetainCountChecker.h.
References clang::T.
Referenced by autorelease(), operator+(), operator-(), operator^(), releaseViaIvar(), and withIvarAccess().
Definition at line 216 of file RetainCountChecker.h.
References getIvarAccessHistory(), getKind(), and X.
Referenced by operator==(), and shouldGenerateNote().
|
inline |
Definition at line 155 of file RetainCountChecker.h.
References getKind(), and NotOwned.
Referenced by generateDiagnosticsForCallLike(), and clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().
|
inline |
Definition at line 151 of file RetainCountChecker.h.
References getKind(), and Owned.
Referenced by generateDiagnosticsForCallLike(), and clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().
|
inline |
Definition at line 163 of file RetainCountChecker.h.
References getKind(), and ReturnedNotOwned.
|
inline |
Definition at line 159 of file RetainCountChecker.h.
References getKind(), and ReturnedOwned.
|
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 179 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 171 of file RetainCountChecker.h.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), refValFromRetEffect(), and updateOutParameters().
Definition at line 188 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
Definition at line 183 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
Definition at line 221 of file RetainCountChecker.h.
References getObjKind(), hasSameState(), clang::T, and X.
Definition at line 193 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getObjKind(), and getType().
void RefVal::print | ( | raw_ostream & | Out | ) | const |
Definition at line 47 of file RetainCountChecker.cpp.
References AccessedDirectly, ErrorDeallocNotOwned, ErrorLeak, ErrorLeakReturned, ErrorOverAutorelease, ErrorReleaseNotOwned, ErrorReturnedNotOwned, ErrorUseAfterRelease, getCount(), getIvarAccessHistory(), getKind(), clang::QualType::isNull(), None, NotOwned, Owned, Released, ReleasedAfterDirectAccess, ReturnedNotOwned, and ReturnedOwned.
|
inline |
Definition at line 225 of file RetainCountChecker.h.
References clang::T.
|
inline |
Definition at line 209 of file RetainCountChecker.h.
References AccessedDirectly, getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), getType(), and ReleasedAfterDirectAccess.
|
inline |
Definition at line 136 of file RetainCountChecker.h.
|
inline |
Definition at line 133 of file RetainCountChecker.h.
|
inline |
Definition at line 203 of file RetainCountChecker.h.
References AccessedDirectly, getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), getType(), and None.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt().