clang 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
clang::ProgramPoint Class Reference

#include "clang/Analysis/ProgramPoint.h"

Inheritance diagram for clang::ProgramPoint:
Inheritance graph
[legend]

Public Types

enum  Kind {
  BlockEdgeKind , BlockEntranceKind , BlockExitKind , PreStmtKind ,
  PreStmtPurgeDeadSymbolsKind , PostStmtPurgeDeadSymbolsKind , PostStmtKind , PreLoadKind ,
  PostLoadKind , PreStoreKind , PostStoreKind , PostConditionKind ,
  PostLValueKind , PostAllocatorCallKind , MinPostStmtKind = PostStmtKind , MaxPostStmtKind = PostAllocatorCallKind ,
  PostInitializerKind , CallEnterKind , CallExitBeginKind , CallExitEndKind ,
  FunctionExitKind , PreImplicitCallKind , PostImplicitCallKind , MinImplicitCallKind = PreImplicitCallKind ,
  MaxImplicitCallKind = PostImplicitCallKind , LoopExitKind , EpsilonKind
}
 

Public Member Functions

ProgramPoint withTag (const ProgramPointTag *tag) const
 Create a new ProgramPoint object that is the same as the original except for using the specified tag value.
 
template<typename T >
T castAs () const
 Convert to the specified ProgramPoint type, asserting that this ProgramPoint is of the desired type.
 
template<typename T >
std::optional< TgetAs () const
 Convert to the specified ProgramPoint type, returning std::nullopt if this ProgramPoint is not of the desired type.
 
Kind getKind () const
 
bool isPurgeKind ()
 Is this a program point corresponding to purge/removal of dead symbols and bindings.
 
const ProgramPointTaggetTag () const
 
const LocationContextgetLocationContext () const
 
const StackFrameContextgetStackFrame () const
 
unsigned getHashValue () const
 
bool operator== (const ProgramPoint &RHS) const
 
bool operator!= (const ProgramPoint &RHS) const
 
void Profile (llvm::FoldingSetNodeID &ID) const
 
void printJson (llvm::raw_ostream &Out, const char *NL="\n") const
 
LLVM_DUMP_METHOD void dump () const
 

Static Public Member Functions

static ProgramPoint getProgramPoint (const Stmt *S, ProgramPoint::Kind K, const LocationContext *LC, const ProgramPointTag *tag)
 

Protected Member Functions

 ProgramPoint ()=default
 
 ProgramPoint (const void *P, Kind k, const LocationContext *l, const ProgramPointTag *tag=nullptr, CFGBlock::ConstCFGElementRef ElemRef={nullptr, 0})
 
 ProgramPoint (const void *P1, const void *P2, Kind k, const LocationContext *l, const ProgramPointTag *tag=nullptr, CFGBlock::ConstCFGElementRef ElemRef={nullptr, 0})
 
const void * getData1 () const
 
const void * getData2 () const
 
void setData2 (const void *d)
 
CFGBlock::ConstCFGElementRef getElementRef () const
 

Detailed Description

Definition at line 58 of file ProgramPoint.h.

Member Enumeration Documentation

◆ Kind

Enumerator
BlockEdgeKind 
BlockEntranceKind 
BlockExitKind 
PreStmtKind 
PreStmtPurgeDeadSymbolsKind 
PostStmtPurgeDeadSymbolsKind 
PostStmtKind 
PreLoadKind 
PostLoadKind 
PreStoreKind 
PostStoreKind 
PostConditionKind 
PostLValueKind 
PostAllocatorCallKind 
MinPostStmtKind 
MaxPostStmtKind 
PostInitializerKind 
CallEnterKind 
CallExitBeginKind 
CallExitEndKind 
FunctionExitKind 
PreImplicitCallKind 
PostImplicitCallKind 
MinImplicitCallKind 
MaxImplicitCallKind 
LoopExitKind 
EpsilonKind 

Definition at line 60 of file ProgramPoint.h.

Constructor & Destructor Documentation

◆ ProgramPoint() [1/3]

clang::ProgramPoint::ProgramPoint ( )
protecteddefault

Referenced by withTag().

◆ ProgramPoint() [2/3]

clang::ProgramPoint::ProgramPoint ( const void *  P,
Kind  k,
const LocationContext l,
const ProgramPointTag tag = nullptr,
CFGBlock::ConstCFGElementRef  ElemRef = {nullptr, 0} 
)
inlineprotected

Definition at line 102 of file ProgramPoint.h.

◆ ProgramPoint() [3/3]

clang::ProgramPoint::ProgramPoint ( const void *  P1,
const void *  P2,
Kind  k,
const LocationContext l,
const ProgramPointTag tag = nullptr,
CFGBlock::ConstCFGElementRef  ElemRef = {nullptr, 0} 
)
inlineprotected

Definition at line 113 of file ProgramPoint.h.

Member Function Documentation

◆ castAs()

template<typename T >
T clang::ProgramPoint::castAs ( ) const
inline

Convert to the specified ProgramPoint type, asserting that this ProgramPoint is of the desired type.

Definition at line 137 of file ProgramPoint.h.

References clang::T.

Referenced by clang::ento::ExprEngine::VisitGuardedExpr(), clang::ento::ExprEngine::VisitLogicalExpr(), and clang::ento::retaincountchecker::RefCountReportVisitor::VisitNode().

◆ dump()

LLVM_DUMP_METHOD void ProgramPoint::dump ( ) const

Definition at line 47 of file ProgramPoint.cpp.

References printJson().

◆ getAs()

template<typename T >
std::optional< T > clang::ProgramPoint::getAs ( ) const
inline

◆ getData1()

const void * clang::ProgramPoint::getData1 ( ) const
inlineprotected

◆ getData2()

const void * clang::ProgramPoint::getData2 ( ) const
inlineprotected

◆ getElementRef()

CFGBlock::ConstCFGElementRef clang::ProgramPoint::getElementRef ( ) const
inlineprotected

Definition at line 124 of file ProgramPoint.h.

◆ getHashValue()

unsigned clang::ProgramPoint::getHashValue ( ) const
inline

Definition at line 184 of file ProgramPoint.h.

References ID, and Profile().

◆ getKind()

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

◆ getLocationContext()

const LocationContext * clang::ProgramPoint::getLocationContext ( ) const
inline

◆ getProgramPoint()

ProgramPoint ProgramPoint::getProgramPoint ( const Stmt S,
ProgramPoint::Kind  K,
const LocationContext LC,
const ProgramPointTag tag 
)
static

◆ getStackFrame()

const StackFrameContext * clang::ProgramPoint::getStackFrame ( ) const
inline

◆ getTag()

const ProgramPointTag * clang::ProgramPoint::getTag ( ) const
inline

◆ isPurgeKind()

bool clang::ProgramPoint::isPurgeKind ( )
inline

Is this a program point corresponding to purge/removal of dead symbols and bindings.

Definition at line 167 of file ProgramPoint.h.

References getKind(), PostStmtPurgeDeadSymbolsKind, and PreStmtPurgeDeadSymbolsKind.

◆ operator!=()

bool clang::ProgramPoint::operator!= ( const ProgramPoint RHS) const
inline

Definition at line 195 of file ProgramPoint.h.

◆ operator==()

bool clang::ProgramPoint::operator== ( const ProgramPoint RHS) const
inline

Definition at line 190 of file ProgramPoint.h.

◆ printJson()

void ProgramPoint::printJson ( llvm::raw_ostream &  Out,
const char *  NL = "\n" 
) const

◆ Profile()

void clang::ProgramPoint::Profile ( llvm::FoldingSetNodeID &  ID) const
inline

Definition at line 200 of file ProgramPoint.h.

References getData1(), getData2(), getKind(), getLocationContext(), getTag(), and ID.

Referenced by getHashValue().

◆ setData2()

void clang::ProgramPoint::setData2 ( const void *  d)
inlineprotected

Definition at line 123 of file ProgramPoint.h.

Referenced by clang::PostStore::PostStore().

◆ withTag()

ProgramPoint clang::ProgramPoint::withTag ( const ProgramPointTag tag) const
inline

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