clang 17.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 51 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 75 of file RetainCountChecker.h.
Definition at line 53 of file RetainCountChecker.h.
|
inline |
Definition at line 199 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
|
inline |
Definition at line 130 of file RetainCountChecker.h.
|
inline |
Definition at line 128 of file RetainCountChecker.h.
Referenced by autorelease(), operator+(), operator-(), operator^(), releaseViaIvar(), shouldGenerateNote(), and withIvarAccess().
|
inline |
Definition at line 129 of file RetainCountChecker.h.
Referenced by shouldGenerateNote().
|
inline |
Definition at line 127 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 148 of file RetainCountChecker.h.
Referenced by autorelease(), hasSameState(), operator+(), operator-(), operator^(), print(), releaseViaIvar(), shouldGenerateNote(), and withIvarAccess().
|
inline |
Definition at line 121 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 123 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 141 of file RetainCountChecker.h.
Referenced by autorelease(), operator+(), operator-(), operator^(), releaseViaIvar(), and withIvarAccess().
Definition at line 217 of file RetainCountChecker.h.
References getIvarAccessHistory(), getKind(), and X.
Referenced by operator==(), and shouldGenerateNote().
|
inline |
Definition at line 156 of file RetainCountChecker.h.
References getKind(), and NotOwned.
Referenced by generateDiagnosticsForCallLike(), and clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().
|
inline |
Definition at line 152 of file RetainCountChecker.h.
References getKind(), and Owned.
Referenced by generateDiagnosticsForCallLike(), and clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().
|
inline |
Definition at line 164 of file RetainCountChecker.h.
References getKind(), and ReturnedNotOwned.
|
inline |
Definition at line 160 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 180 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 172 of file RetainCountChecker.h.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), refValFromRetEffect(), and updateOutParameters().
Definition at line 189 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
Definition at line 184 of file RetainCountChecker.h.
References getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), and getType().
Definition at line 222 of file RetainCountChecker.h.
References getObjKind(), hasSameState(), and X.
Definition at line 194 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 226 of file RetainCountChecker.h.
|
inline |
Definition at line 210 of file RetainCountChecker.h.
References AccessedDirectly, getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), getType(), and ReleasedAfterDirectAccess.
|
inline |
Definition at line 137 of file RetainCountChecker.h.
|
inline |
Definition at line 134 of file RetainCountChecker.h.
|
inline |
Definition at line 204 of file RetainCountChecker.h.
References AccessedDirectly, getAutoreleaseCount(), getCount(), getIvarAccessHistory(), getKind(), getObjKind(), getType(), and None.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt().