clang 20.0.0git
Functions
RetainSummaryManager.cpp File Reference
#include "clang/Analysis/DomainSpecific/CocoaConventions.h"
#include "clang/Analysis/RetainSummaryManager.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 <optional>

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.
 
static bool isSubclass (const Decl *D, StringRef ClassName)
 
static bool isExactClass (const Decl *D, StringRef ClassName)
 
static bool isOSObjectSubclass (const Decl *D)
 
static bool isOSObjectDynamicCast (StringRef S)
 
static bool isOSObjectRequiredCast (StringRef S)
 
static bool isOSObjectThisCast (StringRef S)
 
static bool isOSObjectPtr (QualType QT)
 
static bool isISLObjectRef (QualType Ty)
 
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.
 
static ArgEffect getStopTrackingHardEquivalent (ArgEffect E)
 
static bool hasTypedefNamed (QualType QT, StringRef Name)
 
static QualType getCallableReturnType (const NamedDecl *ND)
 

Function Documentation

◆ getCallableReturnType()

static QualType getCallableReturnType ( const NamedDecl ND)
static

Definition at line 901 of file RetainSummaryManager.cpp.

References clang::FunctionDecl::getReturnType().

◆ getStopTrackingHardEquivalent()

static ArgEffect getStopTrackingHardEquivalent ( ArgEffect  E)
static

◆ hasRCAnnotation()

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

◆ hasTypedefNamed()

static bool hasTypedefNamed ( QualType  QT,
StringRef  Name 
)
static
Returns
Whether the chain of typedefs starting from QT has a typedef with a given name Name.

Definition at line 890 of file RetainSummaryManager.cpp.

References clang::IdentifierTable::get(), clang::Type::getAs(), clang::ASTContext::Idents, and clang::T.

◆ isAutorelease()

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

◆ isExactClass()

static bool isExactClass ( const Decl D,
StringRef  ClassName 
)
static

◆ isISLObjectRef()

static bool isISLObjectRef ( QualType  Ty)
static

Definition at line 176 of file RetainSummaryManager.cpp.

References clang::QualType::getAsString().

◆ isMakeCollectable()

static bool isMakeCollectable ( StringRef  FName)
static

◆ isOneOf() [1/2]

template<class T >
static constexpr bool isOneOf ( )
staticconstexpr

◆ isOneOf() [2/2]

template<class T , class P , class... ToCompare>
static constexpr bool isOneOf ( )
staticconstexpr

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

Definition at line 35 of file RetainSummaryManager.cpp.

References isOneOf(), and clang::T.

◆ isOSIteratorSubclass()

static bool isOSIteratorSubclass ( const Decl D)
static

Definition at line 180 of file RetainSummaryManager.cpp.

References D, and isSubclass().

◆ isOSObjectDynamicCast()

static bool isOSObjectDynamicCast ( StringRef  S)
static

◆ isOSObjectPtr()

static bool isOSObjectPtr ( QualType  QT)
static

◆ 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 213 of file RetainSummaryManager.cpp.

References clang::Type::getAsCXXRecordDecl(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::QualType::isNull(), isOSObjectSubclass(), and clang::FunctionDecl::parameters().

◆ isOSObjectRequiredCast()

static bool isOSObjectRequiredCast ( StringRef  S)
static

◆ isOSObjectSubclass()

static bool isOSObjectSubclass ( const Decl D)
static

◆ isOSObjectThisCast()

static bool isOSObjectThisCast ( StringRef  S)
static

◆ isRelease()

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

Definition at line 197 of file RetainSummaryManager.cpp.

◆ isRetain()

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

◆ isSubclass()

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