clang API Documentation
#include "ClangSACheckers.h"
#include "clang/AST/ParentMap.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.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 "llvm/Support/raw_ostream.h"
Go to the source code of this file.
Enumerations | |
enum | SelfFlagEnum |
Functions | |
static bool | shouldRunOnFunctionOrMethod (const NamedDecl *ND) |
static bool | isInitializationMethod (const ObjCMethodDecl *MD) |
static bool | isInitMessage (const ObjCMethodCall &Msg) |
static bool | isSelfVar (SVal location, CheckerContext &C) |
Returns true if the location is 'self'. | |
static SelfFlagEnum | getSelfFlags (SVal val, ProgramStateRef state) |
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. | |
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. |
enum SelfFlagEnum |
Definition at line 88 of file ObjCSelfInitChecker.cpp.
static void addSelfFlag | ( | ProgramStateRef | state, |
SVal | val, | ||
SelfFlagEnum | flag, | ||
CheckerContext & | C | ||
) | [static] |
Definition at line 118 of file ObjCSelfInitChecker.cpp.
References clang::ento::CheckerContext::addTransition(), clang::ento::SVal::getAsSymbol(), and getSelfFlags().
static SelfFlagEnum getSelfFlags | ( | SVal | val, |
ProgramStateRef | state | ||
) | [static] |
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.
Definition at line 107 of file ObjCSelfInitChecker.cpp.
Referenced by addSelfFlag(), getSelfFlags(), and hasSelfFlag().
static SelfFlagEnum getSelfFlags | ( | SVal | val, |
CheckerContext & | C | ||
) | [static] |
Definition at line 114 of file ObjCSelfInitChecker.cpp.
References getSelfFlags(), and clang::ento::CheckerContext::getState().
static bool hasSelfFlag | ( | SVal | val, |
SelfFlagEnum | flag, | ||
CheckerContext & | C | ||
) | [static] |
Definition at line 127 of file ObjCSelfInitChecker.cpp.
References getSelfFlags().
Referenced by isInvalidSelf().
static bool isInitializationMethod | ( | const ObjCMethodDecl * | MD | ) | [static] |
Definition at line 429 of file ObjCSelfInitChecker.cpp.
References clang::ObjCMethodDecl::getMethodFamily(), and clang::OMF_init.
Referenced by shouldRunOnFunctionOrMethod().
static bool isInitMessage | ( | const ObjCMethodCall & | Msg | ) | [static] |
Definition at line 433 of file ObjCSelfInitChecker.cpp.
References clang::ObjCMethodCall::getMethodFamily(), and 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 134 of file ObjCSelfInitChecker.cpp.
References clang::ento::CheckerContext::getLocationContext(), clang::ento::CheckerContext::getState(), and hasSelfFlag().
static bool isSelfVar | ( | SVal | location, |
CheckerContext & | C | ||
) | [static] |
Returns true if the location is 'self'.
Definition at line 415 of file ObjCSelfInitChecker.cpp.
References clang::ento::SVal::castAs(), clang::ento::SVal::getAs(), clang::ento::CheckerContext::getCurrentAnalysisDeclContext(), clang::AnalysisDeclContext::getSelfDecl(), and clang::ento::loc::MemRegionVal::stripCasts().
static bool shouldRunOnFunctionOrMethod | ( | const NamedDecl * | ND | ) | [static] |
Definition at line 387 of file ObjCSelfInitChecker.cpp.
References clang::IdentifierTable::get(), clang::Decl::getASTContext(), clang::ObjCMethodDecl::getClassInterface(), clang::NamedDecl::getIdentifier(), clang::ObjCInterfaceDecl::getSuperClass(), clang::ASTContext::Idents, and isInitializationMethod().