clang API Documentation
#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>
Go to the source code of this file.
#define createCallEffect | ( | D, | |
KIND | |||
) |
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 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.
static AllocationInfo GetAllocationSite | ( | ProgramStateManager & | StateMgr, |
const ExplodedNode * | N, | ||
SymbolRef | Sym | ||
) | [static] |
Definition at line 2143 of file RetainCountChecker.cpp.
References clang::ProgramPoint::getAs(), clang::ento::MemRegion::getAs(), clang::ento::SVal::getAsSymbol(), clang::ento::MemRegion::getBaseRegion(), clang::LocationContext::getCurrentStackFrame(), clang::ento::ExplodedNode::getLocation(), clang::ento::ExplodedNode::getLocationContext(), getRefBinding(), clang::ento::StoreManager::FindUniqueBinding::getRegion(), clang::ento::VarRegion::getStackFrame(), clang::ento::ExplodedNode::getState(), clang::ento::ProgramStateManager::iterBindings(), clang::OMF_alloc, clang::OMF_init, clang::ento::ExplodedNode::pred_begin(), and clang::ento::ExplodedNode::pred_empty().
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 ArgEffect getStopTrackingHardEquivalent | ( | ArgEffect | E | ) | [static] |
Definition at line 876 of file RetainCountChecker.cpp.
References clang::ento::objc_retain::Autorelease, clang::ento::objc_retain::Dealloc, clang::ento::objc_retain::DecRef, clang::ento::objc_retain::DecRefAndStopTrackingHard, clang::ento::objc_retain::DecRefBridgedTransferred, clang::ento::objc_retain::DecRefMsg, clang::ento::objc_retain::DecRefMsgAndStopTrackingHard, clang::ento::objc_retain::DoNothing, clang::ento::objc_retain::IncRef, clang::ento::objc_retain::IncRefMsg, clang::ento::objc_retain::MakeCollectable, clang::ento::objc_retain::MayEscape, clang::ento::objc_retain::StopTracking, and clang::ento::objc_retain::StopTrackingHard.
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] |
Definition at line 2831 of file RetainCountChecker.cpp.
References clang::ProgramPoint::castAs(), clang::LocationContext::getAnalysisDeclContext(), clang::CallExitEnd::getCalleeContext(), clang::ObjCMethodCall::getDecl(), clang::ento::ExplodedNode::getLocation(), clang::AnalysisDeclContext::isBodyAutosynthesized(), and clang::ObjCMethodDecl::isPropertyAccessor().