clang  8.0.0svn
Classes | Namespaces | Functions
RetainCountChecker.cpp File Reference
#include "RetainCountChecker.h"
Include dependency graph for RetainCountChecker.cpp:

Go to the source code of this file.

Classes

class  clang::ento::retaincountchecker::UseAfterRelease
 
class  clang::ento::retaincountchecker::BadRelease
 
class  clang::ento::retaincountchecker::DeallocNotOwned
 
class  clang::ento::retaincountchecker::OverAutorelease
 
class  clang::ento::retaincountchecker::ReturnedNotOwnedForOwned
 
class  clang::ento::retaincountchecker::Leak
 

Namespaces

 clang
 Dataflow Directional Tag Classes.
 
 clang::ento
 
 clang::ento::retaincountchecker
 

Functions

const RefVal * clang::ento::retaincountchecker::getRefBinding (ProgramStateRef State, SymbolRef Sym)
 
ProgramStateRef clang::ento::retaincountchecker::setRefBinding (ProgramStateRef State, SymbolRef Sym, RefVal Val)
 
ProgramStateRef clang::ento::retaincountchecker::removeRefBinding (ProgramStateRef State, SymbolRef Sym)
 
static QualType GetReturnType (const Expr *RetE, ASTContext &Ctx)
 GetReturnType - Used to get the return type of a message expression or function call with the intention of affixing that type to a tracked symbol. More...
 
static Optional< RefVal > refValFromRetEffect (RetEffect RE, QualType ResultTy)
 
static ProgramStateRef updateOutParameter (ProgramStateRef State, SVal ArgVal, ArgEffect Effect)
 
static bool isPointerToObject (QualType QT)
 
static bool shouldEscapeArgumentOnCall (const CallEvent &CE, unsigned ArgIdx, const RefVal *TrackedValue)
 Whether the tracked value should be escaped on a given call. More...
 
static bool isISLObjectRef (QualType Ty)
 
static bool hasPrevCheckOSObjectOptionDisabled (AnalyzerOptions &Options)
 

Function Documentation

◆ GetReturnType()

static QualType GetReturnType ( const Expr RetE,
ASTContext Ctx 
)
static

GetReturnType - Used to get the return type of a message expression or function call with the intention of affixing that type to a tracked symbol.

While the return type can be queried directly from RetEx, when invoking class methods we augment to the return type to be that of a pointer to the class (as opposed it just being id).

more specific than id.

Definition at line 473 of file RetainCountChecker.cpp.

References clang::Type::getAs(), clang::ASTContext::getObjCInterfaceType(), clang::ASTContext::getObjCObjectPointerType(), and clang::Expr::getType().

Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkSummary().

◆ hasPrevCheckOSObjectOptionDisabled()

static bool hasPrevCheckOSObjectOptionDisabled ( AnalyzerOptions Options)
static

Definition at line 1537 of file RetainCountChecker.cpp.

◆ isISLObjectRef()

static bool isISLObjectRef ( QualType  Ty)
static

◆ isPointerToObject()

static bool isPointerToObject ( QualType  QT)
static

◆ refValFromRetEffect()

static Optional<RefVal> refValFromRetEffect ( RetEffect  RE,
QualType  ResultTy 
)
static

◆ shouldEscapeArgumentOnCall()

static bool shouldEscapeArgumentOnCall ( const CallEvent CE,
unsigned  ArgIdx,
const RefVal *  TrackedValue 
)
static

Whether the tracked value should be escaped on a given call.

OSObjects are escaped when passed to void * / etc.

Definition at line 587 of file RetainCountChecker.cpp.

References isPointerToObject(), clang::ento::RetEffect::OS, and clang::ento::CallEvent::parameters().

Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkSummary().

◆ updateOutParameter()

static ProgramStateRef updateOutParameter ( ProgramStateRef  State,
SVal  ArgVal,
ArgEffect  Effect 
)
static