clang API Documentation

Classes | Namespaces | Defines | Typedefs | Functions
RetainCountChecker.cpp File Reference
#include "ClangSACheckers.h"
#include "AllocationDiagnostics.h"
#include "SelectorExtras.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/ParentMap.h"
#include "clang/Analysis/DomainSpecific/CocoaConventions.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/StaticAnalyzer/Checkers/ObjCRetainCount.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/ImmutableList.h"
#include "llvm/ADT/ImmutableMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include <cstdarg>
Include dependency graph for RetainCountChecker.cpp:

Go to the source code of this file.

Classes

struct  llvm::FoldingSetTrait< ArgEffect >
struct  llvm::FoldingSetTrait< RetEffect >
struct  llvm::DenseMapInfo< ObjCSummaryKey >
struct  AllocationInfo

Namespaces

namespace  llvm
namespace  clang
namespace  clang::ento
namespace  clang::ento::objc_retain

Defines

#define createCallEffect(D, KIND)

Typedefs

typedef llvm::ImmutableMap
< unsigned, ArgEffect
ArgEffects

Functions

static const RefVal * getRefBinding (ProgramStateRef State, SymbolRef Sym)
static ProgramStateRef setRefBinding (ProgramStateRef State, SymbolRef Sym, RefVal Val)
static ProgramStateRef removeRefBinding (ProgramStateRef State, SymbolRef Sym)
static bool isRetain (const FunctionDecl *FD, StringRef FName)
static bool isRelease (const FunctionDecl *FD, StringRef FName)
static bool isAutorelease (const FunctionDecl *FD, StringRef FName)
static bool isMakeCollectable (const FunctionDecl *FD, StringRef FName)
static ArgEffect getStopTrackingHardEquivalent (ArgEffect E)
static bool isNumericLiteralExpression (const Expr *E)
static AllocationInfo GetAllocationSite (ProgramStateManager &StateMgr, const ExplodedNode *N, SymbolRef Sym)
static QualType GetReturnType (const Expr *RetE, ASTContext &Ctx)
static bool wasSynthesizedProperty (const ObjCMethodCall *Call, ExplodedNode *N)

Define Documentation

#define createCallEffect (   D,
  KIND 
)
Value:
ASTContext &Ctx = D->getASTContext();\
  LangOptions L = Ctx.getLangOpts();\
  RetainSummaryManager M(Ctx, L.GCOnly, L.ObjCAutoRefCount);\
  const RetainSummary *S = M.get ## KIND ## Summary(D);\
  CallEffects CE(S->getRetEffect());\
  CE.Receiver = S->getReceiverEffect();\
  unsigned N = D->param_size();\
  for (unsigned i = 0; i < N; ++i) {\
    CE.Args.push_back(S->getArg(i));\
  }

Definition at line 3818 of file RetainCountChecker.cpp.

Referenced by clang::ento::objc_retain::CallEffects::getEffect().


Typedef Documentation

typedef llvm::ImmutableMap<unsigned,ArgEffect> ArgEffects

ArgEffects summarizes the effects of a function/method call on all of its arguments.

Definition at line 72 of file RetainCountChecker.cpp.


Function Documentation

static AllocationInfo GetAllocationSite ( ProgramStateManager StateMgr,
const ExplodedNode N,
SymbolRef  Sym 
) [static]
static const RefVal* getRefBinding ( ProgramStateRef  State,
SymbolRef  Sym 
) [inline, static]

Definition at line 338 of file RetainCountChecker.cpp.

Referenced by GetAllocationSite().

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 2810 of file RetainCountChecker.cpp.

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

static bool isAutorelease ( const FunctionDecl FD,
StringRef  FName 
) [static]

Definition at line 866 of file RetainCountChecker.cpp.

static bool isMakeCollectable ( const FunctionDecl FD,
StringRef  FName 
) [static]

Definition at line 870 of file RetainCountChecker.cpp.

static bool isNumericLiteralExpression ( const Expr E) [static]

Definition at line 1823 of file RetainCountChecker.cpp.

static bool isRelease ( const FunctionDecl FD,
StringRef  FName 
) [static]

Definition at line 862 of file RetainCountChecker.cpp.

static bool isRetain ( const FunctionDecl FD,
StringRef  FName 
) [static]

Definition at line 858 of file RetainCountChecker.cpp.

static ProgramStateRef removeRefBinding ( ProgramStateRef  State,
SymbolRef  Sym 
) [static]

Definition at line 348 of file RetainCountChecker.cpp.

static ProgramStateRef setRefBinding ( ProgramStateRef  State,
SymbolRef  Sym,
RefVal  Val 
) [inline, static]

Definition at line 343 of file RetainCountChecker.cpp.

static bool wasSynthesizedProperty ( const ObjCMethodCall Call,
ExplodedNode N 
) [static]