clang  11.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
clang::CXXAllocatorCall Class Reference

Represents the memory allocation call in a C++ new-expression. More...

#include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"

Inheritance diagram for clang::CXXAllocatorCall:
Inheritance graph
[legend]
Collaboration diagram for clang::CXXAllocatorCall:
Collaboration graph
[legend]

Public Member Functions

virtual const CXXNewExprgetOriginExpr () const
 
const FunctionDeclgetDecl () const override
 
SVal getObjectUnderConstruction () const
 
unsigned getNumImplicitArgs () const
 Number of non-placement arguments to the call. More...
 
unsigned getNumArgs () const override
 
const ExprgetArgExpr (unsigned Index) const override
 
const ExprgetPlacementArgExpr (unsigned Index) const
 Number of placement arguments to the operator new() call. More...
 
Kind getKind () const override
 
virtual StringRef getKindAsString () const override
 

Static Public Member Functions

static bool classof (const CallEvent *CE)
 

Protected Member Functions

 CXXAllocatorCall (const CXXNewExpr *E, ProgramStateRef St, const LocationContext *LCtx)
 
 CXXAllocatorCall (const CXXAllocatorCall &Other)=default
 
void cloneTo (void *Dest) const override
 

Friends

class CallEventManager
 

Detailed Description

Represents the memory allocation call in a C++ new-expression.

This is a call to "operator new".

Definition at line 1008 of file CallEvent.h.

Constructor & Destructor Documentation

◆ CXXAllocatorCall() [1/2]

clang::CXXAllocatorCall::CXXAllocatorCall ( const CXXNewExpr E,
ProgramStateRef  St,
const LocationContext LCtx 
)
inlineprotected

Definition at line 1012 of file CallEvent.h.

◆ CXXAllocatorCall() [2/2]

clang::CXXAllocatorCall::CXXAllocatorCall ( const CXXAllocatorCall Other)
protecteddefault

Member Function Documentation

◆ classof()

static bool clang::CXXAllocatorCall::classof ( const CallEvent CE)
inlinestatic

Definition at line 1065 of file CallEvent.h.

References clang::ento::CE_CXXAllocator.

◆ cloneTo()

void clang::CXXAllocatorCall::cloneTo ( void *  Dest) const
inlineoverrideprotected

Definition at line 1017 of file CallEvent.h.

◆ getArgExpr()

const Expr* clang::CXXAllocatorCall::getArgExpr ( unsigned  Index) const
inlineoverride

Definition at line 1045 of file CallEvent.h.

◆ getDecl()

const FunctionDecl* clang::CXXAllocatorCall::getDecl ( ) const
inlineoverride

Definition at line 1024 of file CallEvent.h.

◆ getKind()

Kind clang::CXXAllocatorCall::getKind ( ) const
inlineoverride

Definition at line 1060 of file CallEvent.h.

References clang::ento::CE_CXXAllocator.

◆ getKindAsString()

virtual StringRef clang::CXXAllocatorCall::getKindAsString ( ) const
inlineoverridevirtual

Definition at line 1061 of file CallEvent.h.

◆ getNumArgs()

unsigned clang::CXXAllocatorCall::getNumArgs ( ) const
inlineoverride

Definition at line 1041 of file CallEvent.h.

◆ getNumImplicitArgs()

unsigned clang::CXXAllocatorCall::getNumImplicitArgs ( ) const
inline

Number of non-placement arguments to the call.

It is equal to 2 for C++17 aligned operator new() calls that have alignment implicitly passed as the second argument, and to 1 for other operator new() calls.

Definition at line 1037 of file CallEvent.h.

◆ getObjectUnderConstruction()

SVal clang::CXXAllocatorCall::getObjectUnderConstruction ( ) const
inline

◆ getOriginExpr()

virtual const CXXNewExpr* clang::CXXAllocatorCall::getOriginExpr ( ) const
inlinevirtual

◆ getPlacementArgExpr()

const Expr* clang::CXXAllocatorCall::getPlacementArgExpr ( unsigned  Index) const
inline

Number of placement arguments to the operator new() call.

For example, standard std::nothrow operator new and standard placement new both have 1 implicit argument (size) and 1 placement argument, while regular operator new() has 1 implicit argument and 0 placement arguments.

Definition at line 1056 of file CallEvent.h.

Friends And Related Function Documentation

◆ CallEventManager

friend class CallEventManager
friend

Definition at line 1009 of file CallEvent.h.


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