clang  10.0.0svn
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::ento::retaincountchecker::RefVal Class Reference

Metadata on reference. More...

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

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...
 

Detailed Description

Metadata on reference.

Definition at line 51 of file RetainCountChecker.h.

Member Enumeration Documentation

◆ IvarAccessHistory

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.

◆ Kind

Enumerator
Owned 
NotOwned 
Released 
ReturnedOwned 
ReturnedNotOwned 
ERROR_START 
ErrorDeallocNotOwned 
ErrorUseAfterRelease 
ErrorReleaseNotOwned 
ERROR_LEAK_START 
ErrorLeak 
ErrorLeakReturned 
ErrorOverAutorelease 
ErrorReturnedNotOwned 

Definition at line 53 of file RetainCountChecker.h.

Member Function Documentation

◆ autorelease()

RefVal clang::ento::retaincountchecker::RefVal::autorelease ( ) const
inline

◆ clearCounts()

void clang::ento::retaincountchecker::RefVal::clearCounts ( )
inline

◆ getAutoreleaseCount()

unsigned clang::ento::retaincountchecker::RefVal::getAutoreleaseCount ( ) const
inline

◆ getCombinedCounts()

unsigned clang::ento::retaincountchecker::RefVal::getCombinedCounts ( ) const
inline

Definition at line 129 of file RetainCountChecker.h.

◆ getCount()

unsigned clang::ento::retaincountchecker::RefVal::getCount ( ) const
inline

◆ getIvarAccessHistory()

IvarAccessHistory clang::ento::retaincountchecker::RefVal::getIvarAccessHistory ( ) const
inline

◆ getKind()

Kind clang::ento::retaincountchecker::RefVal::getKind ( ) const
inline

◆ getObjKind()

ObjKind clang::ento::retaincountchecker::RefVal::getObjKind ( ) const
inline

◆ getType()

QualType clang::ento::retaincountchecker::RefVal::getType ( ) const
inline

◆ hasSameState()

bool clang::ento::retaincountchecker::RefVal::hasSameState ( const RefVal X) const
inline

Definition at line 217 of file RetainCountChecker.h.

References getIvarAccessHistory(), and getKind().

Referenced by operator==().

◆ isNotOwned()

bool clang::ento::retaincountchecker::RefVal::isNotOwned ( ) const
inline

◆ isOwned()

bool clang::ento::retaincountchecker::RefVal::isOwned ( ) const
inline

◆ isReturnedNotOwned()

bool clang::ento::retaincountchecker::RefVal::isReturnedNotOwned ( ) const
inline

◆ isReturnedOwned()

bool clang::ento::retaincountchecker::RefVal::isReturnedOwned ( ) const
inline

◆ makeNotOwned()

static RefVal clang::ento::retaincountchecker::RefVal::makeNotOwned ( ObjKind  o,
QualType  t 
)
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().

◆ makeOwned()

static RefVal clang::ento::retaincountchecker::RefVal::makeOwned ( ObjKind  o,
QualType  t 
)
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.

References None, and Owned.

Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), refValFromRetEffect(), and updateOutParameters().

◆ operator+()

RefVal clang::ento::retaincountchecker::RefVal::operator+ ( size_t  i) const
inline

◆ operator-()

RefVal clang::ento::retaincountchecker::RefVal::operator- ( size_t  i) const
inline

◆ operator==()

bool clang::ento::retaincountchecker::RefVal::operator== ( const RefVal X) const
inline

Definition at line 222 of file RetainCountChecker.h.

References getObjKind(), and hasSameState().

◆ operator^()

RefVal clang::ento::retaincountchecker::RefVal::operator^ ( Kind  k) const
inline

◆ print()

void RefVal::print ( raw_ostream &  Out) const

◆ Profile()

void clang::ento::retaincountchecker::RefVal::Profile ( llvm::FoldingSetNodeID &  ID) const
inline

Definition at line 226 of file RetainCountChecker.h.

References print().

◆ releaseViaIvar()

RefVal clang::ento::retaincountchecker::RefVal::releaseViaIvar ( ) const
inline

◆ setAutoreleaseCount()

void clang::ento::retaincountchecker::RefVal::setAutoreleaseCount ( unsigned  i)
inline

◆ setCount()

void clang::ento::retaincountchecker::RefVal::setCount ( unsigned  i)
inline

◆ withIvarAccess()

RefVal clang::ento::retaincountchecker::RefVal::withIvarAccess ( ) const
inline

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