clang 8.0.0

Functions
RetainSummaryManager.cpp File Reference
`#include "clang/StaticAnalyzer/Core/RetainSummaryManager.h"`
`#include "clang/Analysis/DomainSpecific/CocoaConventions.h"`
`#include "clang/AST/Attr.h"`
`#include "clang/AST/DeclCXX.h"`
`#include "clang/AST/DeclObjC.h"`
`#include "clang/AST/ParentMap.h"`
`#include "clang/ASTMatchers/ASTMatchFinder.h"`
Include dependency graph for RetainSummaryManager.cpp:

Go to the source code of this file.

## Functions
template<class T >
static constexpr bool | isOneOf ()
template<class T , class P , class... ToCompare>
static constexpr bool | isOneOf ()
| Helper function to check whether the class is one of the rest of varargs. More...
static bool | isSubclass (const Decl *D, StringRef ClassName)
static bool | isOSObjectSubclass (const Decl *D)
static bool | isOSObjectDynamicCast (StringRef S)
static bool | isOSIteratorSubclass (const Decl *D)
static bool | hasRCAnnotation (const Decl *D, StringRef rcAnnotation)
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 (StringRef FName)
static bool | isOSObjectRelated (const CXXMethodDecl *MD)
| A function is OSObject related if it is declared on a subclass of OSObject, or any of the parameters is a subclass of an OSObject. More...
static ArgEffect | getStopTrackingHardEquivalent (ArgEffect E)

## Function Documentation

## ◆ getStopTrackingHardEquivalent()

static ArgEffect getStopTrackingHardEquivalent | ( | ArgEffect | E | ) |
| static

Definition at line 519 of file RetainSummaryManager.cpp.

References clang::ento::Autorelease, clang::ento::Dealloc, clang::ento::DecRef, clang::ento::DecRefAndStopTrackingHard, clang::ento::DecRefBridgedTransferred, clang::ento::DoNothing, clang::ento::ArgEffect::getKind(), clang::ento::IncRef, clang::ento::MayEscape, clang::ento::RetainedOutParameter, clang::ento::RetainedOutParameterOnNonZero, clang::ento::RetainedOutParameterOnZero, clang::ento::StopTracking, clang::ento::StopTrackingHard, clang::ento::UnretainedOutParameter, and clang::ento::ArgEffect::withKind().

## ◆ hasRCAnnotation()

static bool hasRCAnnotation | ( | const Decl * | D,
|  | StringRef | rcAnnotation
| ) |  |
| static

Definition at line 160 of file RetainSummaryManager.cpp.

References clang::Decl::specific_attrs().

## ◆ isAutorelease()

static bool isAutorelease | ( | const FunctionDecl * | FD,
|  | StringRef | FName
| ) |  |
| static

Definition at line 176 of file RetainSummaryManager.cpp.

Referenced by isOSObjectRelated().

## ◆ isMakeCollectable()

static bool isMakeCollectable | ( | StringRef | FName | ) |
| static

Definition at line 181 of file RetainSummaryManager.cpp.

Referenced by isOSObjectRelated().

## ◆ isOneOf() [1/2]

template<class T >

static constexpr bool isOneOf | ( |  | ) |
| static

Definition at line 28 of file RetainSummaryManager.cpp.

References P.

Referenced by getMissingDeclaratorIdLoc(), and isOneOf().

## ◆ isOneOf() [2/2]

template<class T , class P , class... ToCompare>

static constexpr bool isOneOf | ( |  | ) |
| static

Helper function to check whether the class is one of the rest of varargs.

Definition at line 35 of file RetainSummaryManager.cpp.

References clang::ento::CF, clang::classof(), clang::ento::Generalized, clang::Decl::hasAttr(), clang::ento::cocoa::isCocoaObjectRef(), isOneOf(), clang::ento::ObjC, and clang::ento::OS.

## ◆ isOSIteratorSubclass()

static bool isOSIteratorSubclass | ( | const Decl * | D | ) |
| static

Definition at line 156 of file RetainSummaryManager.cpp.

References isSubclass().

Referenced by isOSObjectRelated().

## ◆ isOSObjectDynamicCast()

static bool isOSObjectDynamicCast | ( | StringRef | S | ) |
| static

Definition at line 152 of file RetainSummaryManager.cpp.

Referenced by isOSObjectRelated().

## ◆ isOSObjectRelated()

static bool isOSObjectRelated | ( | const CXXMethodDecl * | MD | ) |
| static

A function is OSObject related if it is declared on a subclass of OSObject, or any of the parameters is a subclass of an OSObject.

Definition at line 187 of file RetainSummaryManager.cpp.

References clang::ento::Autorelease, clang::ento::CF, clang::ento::DecRef, clang::ento::DoNothing, clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::QualType::getAsString(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::FunctionType::getReturnType(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::ento::IncRef, isAutorelease(), clang::ento::coreFoundation::isCFObjectRef(), clang::Decl::isImplicit(), isMakeCollectable(), clang::QualType::isNull(), clang::Type::isObjCIdType(), isOSIteratorSubclass(), isOSObjectDynamicCast(), isOSObjectSubclass(), clang::Type::isPointerType(), clang::ento::cocoa::isRefType(), isRelease(), isRetain(), clang::ento::RetEffect::MakeNoRet(), clang::ento::RetEffect::MakeOwned(), clang::ento::MayEscape, clang::FunctionDecl::parameters(), Parent, and clang::ento::StopTracking.

## ◆ isOSObjectSubclass()

static bool isOSObjectSubclass | ( | const Decl * | D | ) |
| static

Definition at line 148 of file RetainSummaryManager.cpp.

References isSubclass().

Referenced by isOSObjectRelated().

## ◆ isRelease()

static bool isRelease | ( | const FunctionDecl * | FD,
|  | StringRef | FName
| ) |  |
| static

Definition at line 172 of file RetainSummaryManager.cpp.

Referenced by isOSObjectRelated().

## ◆ isRetain()

static bool isRetain | ( | const FunctionDecl * | FD,
|  | StringRef | FName
| ) |  |
| static

Definition at line 168 of file RetainSummaryManager.cpp.

Referenced by isOSObjectRelated().

## ◆ isSubclass()

static bool isSubclass | ( | const Decl * | D,
|  | StringRef | ClassName
| ) |  |
| static

Definition at line 141 of file RetainSummaryManager.cpp.

References clang::ast_matchers::cxxRecordDecl, clang::Decl::getASTContext(), and clang::ast_matchers::match().

Referenced by isOSIteratorSubclass(), and isOSObjectSubclass().