clang 22.0.0git
clang::ento::CallEventManager Class Reference

Manages the lifetime of CallEvent objects. More...

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

Public Member Functions

 CallEventManager (llvm::BumpPtrAllocator &alloc)
CallEventRef getCaller (const StackFrameContext *CalleeCtx, ProgramStateRef State)
 Gets an outside caller given a callee context.
CallEventRef getCall (const Stmt *S, ProgramStateRef State, const LocationContext *LC, CFGBlock::ConstCFGElementRef ElemRef)
 Gets a call event for a function call, Objective-C method call, a 'new', or a 'delete' call.
CallEventRef getSimpleCall (const CallExpr *E, ProgramStateRef State, const LocationContext *LCtx, CFGBlock::ConstCFGElementRef ElemRef)
CallEventRef< ObjCMethodCallgetObjCMethodCall (const ObjCMessageExpr *E, ProgramStateRef State, const LocationContext *LCtx, CFGBlock::ConstCFGElementRef ElemRef)
CallEventRef< CXXConstructorCallgetCXXConstructorCall (const CXXConstructExpr *E, const MemRegion *Target, ProgramStateRef State, const LocationContext *LCtx, CFGBlock::ConstCFGElementRef ElemRef)
CallEventRef< CXXInheritedConstructorCallgetCXXInheritedConstructorCall (const CXXInheritedCtorInitExpr *E, const MemRegion *Target, ProgramStateRef State, const LocationContext *LCtx, CFGBlock::ConstCFGElementRef ElemRef)
CallEventRef< CXXDestructorCallgetCXXDestructorCall (const CXXDestructorDecl *DD, const Stmt *Trigger, const MemRegion *Target, bool IsBase, ProgramStateRef State, const LocationContext *LCtx, CFGBlock::ConstCFGElementRef ElemRef)
CallEventRef< CXXAllocatorCallgetCXXAllocatorCall (const CXXNewExpr *E, ProgramStateRef State, const LocationContext *LCtx, CFGBlock::ConstCFGElementRef ElemRef)
CallEventRef< CXXDeallocatorCallgetCXXDeallocatorCall (const CXXDeleteExpr *E, ProgramStateRef State, const LocationContext *LCtx, CFGBlock::ConstCFGElementRef ElemRef)

Friends

class CallEvent

Detailed Description

Manages the lifetime of CallEvent objects.

CallEventManager provides a way to create arbitrary CallEvents "on the stack" as if they were value objects by keeping a cache of CallEvent-sized memory blocks. The CallEvents created by CallEventManager are only valid for the lifetime of the OwnedCallEvent that holds them; right now these objects cannot be copied and ownership cannot be transferred.

Definition at line 1363 of file CallEvent.h.

Constructor & Destructor Documentation

◆ CallEventManager()

clang::ento::CallEventManager::CallEventManager ( llvm::BumpPtrAllocator & alloc)
inline

Definition at line 1417 of file CallEvent.h.

Member Function Documentation

◆ getCall()

CallEventRef CallEventManager::getCall ( const Stmt * S,
ProgramStateRef State,
const LocationContext * LC,
CFGBlock::ConstCFGElementRef ElemRef )

Gets a call event for a function call, Objective-C method call, a 'new', or a 'delete' call.

Definition at line 1508 of file CallEvent.cpp.

References getCXXAllocatorCall(), getCXXDeallocatorCall(), getObjCMethodCall(), and getSimpleCall().

Referenced by generateDiagnosticsForCallLike(), and getCaller().

◆ getCaller()

◆ getCXXAllocatorCall()

CallEventRef< CXXAllocatorCall > clang::ento::CallEventManager::getCXXAllocatorCall ( const CXXNewExpr * E,
ProgramStateRef State,
const LocationContext * LCtx,
CFGBlock::ConstCFGElementRef ElemRef )
inline

◆ getCXXConstructorCall()

CallEventRef< CXXConstructorCall > clang::ento::CallEventManager::getCXXConstructorCall ( const CXXConstructExpr * E,
const MemRegion * Target,
ProgramStateRef State,
const LocationContext * LCtx,
CFGBlock::ConstCFGElementRef ElemRef )
inline

Definition at line 1441 of file CallEvent.h.

References clang::Target.

Referenced by clang::ento::ExprEngine::computeObjectUnderConstruction(), and getCaller().

◆ getCXXDeallocatorCall()

CallEventRef< CXXDeallocatorCall > clang::ento::CallEventManager::getCXXDeallocatorCall ( const CXXDeleteExpr * E,
ProgramStateRef State,
const LocationContext * LCtx,
CFGBlock::ConstCFGElementRef ElemRef )
inline

Definition at line 1472 of file CallEvent.h.

Referenced by getCall(), and clang::ento::ExprEngine::VisitCXXDeleteExpr().

◆ getCXXDestructorCall()

CallEventRef< CXXDestructorCall > clang::ento::CallEventManager::getCXXDestructorCall ( const CXXDestructorDecl * DD,
const Stmt * Trigger,
const MemRegion * Target,
bool IsBase,
ProgramStateRef State,
const LocationContext * LCtx,
CFGBlock::ConstCFGElementRef ElemRef )
inline

Definition at line 1456 of file CallEvent.h.

References clang::Target.

Referenced by getCaller(), and clang::ento::ExprEngine::VisitCXXDestructor().

◆ getCXXInheritedConstructorCall()

CallEventRef< CXXInheritedConstructorCall > clang::ento::CallEventManager::getCXXInheritedConstructorCall ( const CXXInheritedCtorInitExpr * E,
const MemRegion * Target,
ProgramStateRef State,
const LocationContext * LCtx,
CFGBlock::ConstCFGElementRef ElemRef )
inline

Definition at line 1448 of file CallEvent.h.

References clang::Target.

Referenced by getCaller().

◆ getObjCMethodCall()

◆ getSimpleCall()

◆ CallEvent

friend class CallEvent
friend

Definition at line 1364 of file CallEvent.h.

References CallEvent.

Referenced by CallEvent.


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