clang API Documentation

Classes | Namespaces | Typedefs | Enumerations | Functions
ObjCSelfInitChecker.cpp File Reference
#include "ClangSACheckers.h"
#include "clang/StaticAnalyzer/Core/Checker.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/AST/ParentMap.h"
Include dependency graph for ObjCSelfInitChecker.cpp:

Go to the source code of this file.

Classes

struct  clang::ento::ProgramStateTrait< SelfFlag >
struct  clang::ento::ProgramStateTrait< CalledInit >
struct  clang::ento::ProgramStateTrait< PreCallSelfFlags >
 A call receiving a reference to 'self' invalidates the object that 'self' contains. This keeps the "self flags" assigned to the 'self' object before the call so we can assign them to the new object that 'self' points to after the call. More...

Namespaces

namespace  clang
namespace  clang::ento

Typedefs

typedef llvm::ImmutableMap
< SymbolRef, unsigned > 
SelfFlag

Enumerations

enum  SelfFlagEnum

Functions

static bool shouldRunOnFunctionOrMethod (const NamedDecl *ND)
static bool isInitializationMethod (const ObjCMethodDecl *MD)
static bool isInitMessage (const ObjCMessage &msg)
static bool isSelfVar (SVal location, CheckerContext &C)
 Returns true if the location is 'self'.
static SelfFlagEnum getSelfFlags (SVal val, ProgramStateRef state)
static SelfFlagEnum getSelfFlags (SVal val, CheckerContext &C)
static void addSelfFlag (ProgramStateRef state, SVal val, SelfFlagEnum flag, CheckerContext &C)
static bool hasSelfFlag (SVal val, SelfFlagEnum flag, CheckerContext &C)
static bool isInvalidSelf (const Expr *E, CheckerContext &C)
 Returns true of the value of the expression is the object that 'self' points to and is an object that did not come from the result of calling an initializer.
static void checkForInvalidSelf (const Expr *E, CheckerContext &C, const char *errorStr)

Typedef Documentation

typedef llvm::ImmutableMap<SymbolRef, unsigned> SelfFlag

Definition at line 104 of file ObjCSelfInitChecker.cpp.


Enumeration Type Documentation

Definition at line 94 of file ObjCSelfInitChecker.cpp.


Function Documentation

static void addSelfFlag ( ProgramStateRef  state,
SVal  val,
SelfFlagEnum  flag,
CheckerContext &  C 
) [static]

Definition at line 141 of file ObjCSelfInitChecker.cpp.

References getSelfFlags().

static void checkForInvalidSelf ( const Expr E,
CheckerContext &  C,
const char *  errorStr 
) [static]

Definition at line 165 of file ObjCSelfInitChecker.cpp.

References isInvalidSelf().

static SelfFlagEnum getSelfFlags ( SVal  val,
ProgramStateRef  state 
) [static]

Definition at line 130 of file ObjCSelfInitChecker.cpp.

Referenced by addSelfFlag(), getSelfFlags(), and hasSelfFlag().

static SelfFlagEnum getSelfFlags ( SVal  val,
CheckerContext &  C 
) [static]

Definition at line 137 of file ObjCSelfInitChecker.cpp.

References getSelfFlags().

static bool hasSelfFlag ( SVal  val,
SelfFlagEnum  flag,
CheckerContext &  C 
) [static]

Definition at line 148 of file ObjCSelfInitChecker.cpp.

References getSelfFlags().

Referenced by isInvalidSelf().

static bool isInitializationMethod ( const ObjCMethodDecl MD) [static]
static bool isInitMessage ( const ObjCMessage &  msg) [static]

Definition at line 410 of file ObjCSelfInitChecker.cpp.

References clang::OMF_init.

static bool isInvalidSelf ( const Expr E,
CheckerContext &  C 
) [static]

Returns true of the value of the expression is the object that 'self' points to and is an object that did not come from the result of calling an initializer.

Definition at line 155 of file ObjCSelfInitChecker.cpp.

References hasSelfFlag().

Referenced by checkForInvalidSelf().

static bool isSelfVar ( SVal  location,
CheckerContext &  C 
) [static]

Returns true if the location is 'self'.

Definition at line 392 of file ObjCSelfInitChecker.cpp.

References clang::AnalysisDeclContext::getSelfDecl().

static bool shouldRunOnFunctionOrMethod ( const NamedDecl ND) [static]