clang 10.0.0git

Public Member Functions | Friends | List of all members
clang::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. More...
CallEventRef | getCall (const Stmt *S, ProgramStateRef State, const LocationContext *LC)
| Gets a call event for a function call, Objective-C method call, or a 'new' call. More...
CallEventRef | getSimpleCall (const CallExpr *E, ProgramStateRef State, const LocationContext *LCtx)
CallEventRef< ObjCMethodCall > | getObjCMethodCall (const ObjCMessageExpr *E, ProgramStateRef State, const LocationContext *LCtx)
CallEventRef< CXXConstructorCall > | getCXXConstructorCall (const CXXConstructExpr *E, const MemRegion *Target, ProgramStateRef State, const LocationContext *LCtx)
CallEventRef< CXXDestructorCall > | getCXXDestructorCall (const CXXDestructorDecl *DD, const Stmt *Trigger, const MemRegion *Target, bool IsBase, ProgramStateRef State, const LocationContext *LCtx)
CallEventRef< CXXAllocatorCall > | getCXXAllocatorCall (const CXXNewExpr *E, ProgramStateRef State, const LocationContext *LCtx)

## 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 1148 of file CallEvent.h.

## Constructor & Destructor Documentation

## ◆ CallEventManager()

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

Definition at line 1200 of file CallEvent.h.

References State.

## Member Function Documentation

## ◆ getCall()

CallEventRef CallEventManager::getCall | ( | const Stmt * | S,
|  | ProgramStateRef | State,
|  | const LocationContext * | LC
| ) |  |

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

Definition at line 1433 of file CallEvent.cpp.

## ◆ getCaller()

CallEventRef CallEventManager::getCaller | ( | const StackFrameContext * | CalleeCtx,
|  | ProgramStateRef | State
| ) |  |

Gets an outside caller given a callee context.

Definition at line 1383 of file CallEvent.cpp.

References clang::CFGElement::getAs(), clang::StackFrameContext::getCallSite(), clang::StackFrameContext::getCallSiteBlock(), clang::LocationContext::getDecl(), clang::StackFrameContext::getIndex(), clang::LocationContext::getParent(), and clang::LocationContext::getStackFrame().

Referenced by clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::processEndOfFunction(), and showBRDefaultDiagnostics().

## ◆ getCXXAllocatorCall()

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

Definition at line 1236 of file CallEvent.h.

References State.

Referenced by clang::ento::ExprEngine::VisitCXXNewExpr().

## ◆ getCXXConstructorCall()

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

Definition at line 1223 of file CallEvent.h.

References State.

Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject(), and clang::ento::ExprEngine::VisitCXXConstructExpr().

## ◆ getCXXDestructorCall()

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

Definition at line 1229 of file CallEvent.h.

References State.

## ◆ getObjCMethodCall()

CallEventRef<ObjCMethodCall> clang::CallEventManager::getObjCMethodCall | ( | const ObjCMessageExpr * | E,
|  | ProgramStateRef | State,
|  | const LocationContext * | LCtx
| ) |  |
| inline

Definition at line 1217 of file CallEvent.h.

References State.

Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject(), and clang::ento::ExprEngine::VisitObjCMessage().

## ◆ getSimpleCall()

CallEventRef CallEventManager::getSimpleCall | ( | const CallExpr * | E,
|  | ProgramStateRef | State,
|  | const LocationContext * | LCtx
| ) |  |

Definition at line 1362 of file CallEvent.cpp.

References clang::CallExpr::getCallee(), clang::Expr::getType(), and clang::Type::isBlockPointerType().

Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject(), and clang::ento::ExprEngine::VisitCallExpr().

## Friends And Related Function Documentation

## ◆ CallEvent

friend class CallEvent
| friend

Definition at line 1149 of file CallEvent.h.

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

- include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
- lib/StaticAnalyzer/Core/CallEvent.cpp