clang 24.0.0git
clang::AnyCall Class Reference

An instance of this class corresponds to a call. More...

#include "clang/Analysis/AnyCall.h"

Public Types

enum  Kind {
  Function , ObjCMethod , Block , Destructor ,
  Constructor , InheritedConstructor , Allocator , Deallocator
}
using param_const_iterator = ArrayRef<ParmVarDecl *>::const_iterator

Public Member Functions

 AnyCall (const CallExpr *CE)
 AnyCall (const ObjCMessageExpr *ME)
 AnyCall (const CXXNewExpr *NE)
 AnyCall (const CXXDeleteExpr *NE)
 AnyCall (const CXXConstructExpr *NE)
 AnyCall (const CXXInheritedCtorInitExpr *CIE)
 AnyCall (const CXXDestructorDecl *D)
 AnyCall (const CXXConstructorDecl *D)
 AnyCall (const ObjCMethodDecl *D)
 AnyCall (const FunctionDecl *D)
ArrayRef< ParmVarDecl * > parameters () const
param_const_iterator param_begin () const
param_const_iterator param_end () const
size_t param_size () const
bool param_empty () const
llvm::SmallVector< const Expr *, 4 > arguments () const
size_t arg_size () const
bool arg_empty () const
const ExprgetArg (unsigned I) const
QualType getReturnType (ASTContext &Ctx) const
const IdentifierInfogetIdentifier () const
const DeclgetDecl () const
const ExprgetExpr () const
Kind getKind () const
void dump () const

Static Public Member Functions

static std::optional< AnyCallforExpr (const Expr *E)
 If E is a generic call (to ObjC method /function/block/etc), return a constructed AnyCall object.
static std::optional< AnyCallforDecl (const Decl *D)
 If D is a callable (Objective-C method or a function), return a constructed AnyCall object.

Detailed Description

An instance of this class corresponds to a call.

It might be a syntactically-concrete call, done as a part of evaluating an expression, or it may be an abstract callee with no associated expression.

Definition at line 27 of file AnyCall.h.

Member Typedef Documentation

◆ param_const_iterator

Definition at line 160 of file AnyCall.h.

Member Enumeration Documentation

◆ Kind

Enumerator
Function 

A function, function pointer, or a C++ method call.

ObjCMethod 

A call to an Objective-C method.

Block 

A call to an Objective-C block.

Destructor 

An implicit C++ destructor call (called implicitly or by operator 'delete')

Constructor 

An implicit or explicit C++ constructor call.

InheritedConstructor 

A C++ inherited constructor produced by a "using T::T" directive.

Allocator 

A C++ allocation function call (operator new), via C++ new-expression.

Deallocator 

A C++ deallocation function call (operator delete), via C++ delete-expression.

Definition at line 29 of file AnyCall.h.

Constructor & Destructor Documentation

◆ AnyCall() [1/10]

clang::AnyCall::AnyCall ( const CallExpr * CE)
inline

◆ AnyCall() [2/10]

clang::AnyCall::AnyCall ( const ObjCMessageExpr * ME)
inline

Definition at line 80 of file AnyCall.h.

References ObjCMethod.

◆ AnyCall() [3/10]

clang::AnyCall::AnyCall ( const CXXNewExpr * NE)
inline

Definition at line 83 of file AnyCall.h.

References Allocator.

◆ AnyCall() [4/10]

clang::AnyCall::AnyCall ( const CXXDeleteExpr * NE)
inline

Definition at line 86 of file AnyCall.h.

References Deallocator.

◆ AnyCall() [5/10]

clang::AnyCall::AnyCall ( const CXXConstructExpr * NE)
inline

Definition at line 89 of file AnyCall.h.

References Constructor.

◆ AnyCall() [6/10]

clang::AnyCall::AnyCall ( const CXXInheritedCtorInitExpr * CIE)
inline

Definition at line 92 of file AnyCall.h.

References InheritedConstructor.

◆ AnyCall() [7/10]

clang::AnyCall::AnyCall ( const CXXDestructorDecl * D)
inline

Definition at line 95 of file AnyCall.h.

References Destructor, and clang::nullptr.

◆ AnyCall() [8/10]

clang::AnyCall::AnyCall ( const CXXConstructorDecl * D)
inline

Definition at line 97 of file AnyCall.h.

References Constructor, and clang::nullptr.

◆ AnyCall() [9/10]

clang::AnyCall::AnyCall ( const ObjCMethodDecl * D)
inline

Definition at line 99 of file AnyCall.h.

References clang::nullptr, and ObjCMethod.

◆ AnyCall() [10/10]

clang::AnyCall::AnyCall ( const FunctionDecl * D)
inline

Definition at line 101 of file AnyCall.h.

References Constructor, Destructor, Function, clang::isa(), and clang::nullptr.

Member Function Documentation

◆ arg_empty()

bool clang::AnyCall::arg_empty ( ) const
inline

Definition at line 215 of file AnyCall.h.

References arguments().

◆ arg_size()

size_t clang::AnyCall::arg_size ( ) const
inline

Definition at line 214 of file AnyCall.h.

References arguments().

◆ arguments()

llvm::SmallVector< const Expr *, 4 > clang::AnyCall::arguments ( ) const
inline
Returns
actual arguments for expression-backed calls, or an empty list for declaration-backed calls and call kinds with implicit or synthesized argument lists, such as allocators and destructors. For instance member calls, the implicit object argument is included as argument 0.

Definition at line 170 of file AnyCall.h.

References Allocator, Block, clang::cast(), Constructor, Deallocator, Destructor, Function, InheritedConstructor, and ObjCMethod.

Referenced by arg_empty(), arg_size(), and getArg().

◆ dump()

void clang::AnyCall::dump ( ) const
inline

Definition at line 262 of file AnyCall.h.

◆ forDecl()

std::optional< AnyCall > clang::AnyCall::forDecl ( const Decl * D)
inlinestatic

If D is a callable (Objective-C method or a function), return a constructed AnyCall object.

Return std::nullopt otherwise.

Definition at line 135 of file AnyCall.h.

References AnyCall().

Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkBeginFunction(), and isInMIGCall().

◆ forExpr()

std::optional< AnyCall > clang::AnyCall::forExpr ( const Expr * E)
inlinestatic

If E is a generic call (to ObjC method /function/block/etc), return a constructed AnyCall object.

Return std::nullopt otherwise.

Definition at line 114 of file AnyCall.h.

References AnyCall().

Referenced by clang ::lifetimes::FunctionCallInfo::FunctionCallInfo(), and getSummary().

◆ getArg()

const Expr * clang::AnyCall::getArg ( unsigned I) const
inline

Definition at line 216 of file AnyCall.h.

References arguments().

◆ getDecl()

const Decl * clang::AnyCall::getDecl ( ) const
inline

Definition at line 250 of file AnyCall.h.

◆ getExpr()

const Expr * clang::AnyCall::getExpr ( ) const
inline

Definition at line 254 of file AnyCall.h.

◆ getIdentifier()

const IdentifierInfo * clang::AnyCall::getIdentifier ( ) const
inline
Returns
Function identifier if it is a named declaration, nullptr otherwise.

Definition at line 244 of file AnyCall.h.

◆ getKind()

Kind clang::AnyCall::getKind ( ) const
inline

Definition at line 258 of file AnyCall.h.

◆ getReturnType()

QualType clang::AnyCall::getReturnType ( ASTContext & Ctx) const
inline

◆ param_begin()

param_const_iterator clang::AnyCall::param_begin ( ) const
inline

Definition at line 161 of file AnyCall.h.

References parameters().

◆ param_empty()

bool clang::AnyCall::param_empty ( ) const
inline

Definition at line 164 of file AnyCall.h.

References parameters().

◆ param_end()

param_const_iterator clang::AnyCall::param_end ( ) const
inline

Definition at line 162 of file AnyCall.h.

References parameters().

◆ param_size()

size_t clang::AnyCall::param_size ( ) const
inline

Definition at line 163 of file AnyCall.h.

References parameters().

◆ parameters()

ArrayRef< ParmVarDecl * > clang::AnyCall::parameters ( ) const
inline
Returns
formal parameters for direct calls (including virtual calls)

Definition at line 145 of file AnyCall.h.

Referenced by param_begin(), param_empty(), param_end(), and param_size().


The documentation for this class was generated from the following file: