clang 10.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:
[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. More...
template<typename T >
T | castAs () const
| Convert to the specified ProgramPoint type, asserting that this ProgramPoint is of the desired type. More...
template<typename T >
Optional< T > | getAs () const
| Convert to the specified ProgramPoint type, returning None if this ProgramPoint is not of the desired type. More...
Kind | getKind () const
bool | isPurgeKind ()
| Is this a program point corresponding to purge/removal of dead symbols and bindings. More...
const ProgramPointTag * | getTag () const
const LocationContext * | getLocationContext () const
const StackFrameContext * | getStackFrame () 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="\) 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)
| ProgramPoint (const void *P1, const void *P2, Kind k, const LocationContext *l, const ProgramPointTag *tag=nullptr)
const void * | getData1 () const
const void * | getData2 () const
void | setData2 (const void *d)

## Detailed Description

Definition at line 59 of file ProgramPoint.h.

## Member Enumeration Documentation

## ◆ Kind

enum clang::ProgramPoint::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 61 of file ProgramPoint.h.

## Constructor & Destructor Documentation

## ◆ ProgramPoint() [1/3]

clang::ProgramPoint::ProgramPoint | ( |  | ) |
| protected default

## ◆ ProgramPoint() [2/3]

clang::ProgramPoint::ProgramPoint | ( | const void * | P,
|  | Kind | k,
|  | const LocationContext * | l,
|  | const ProgramPointTag * | tag = `nullptr`
| ) |  |
| inline protected

Definition at line 101 of file ProgramPoint.h.

References getKind().

## ◆ ProgramPoint() [3/3]

clang::ProgramPoint::ProgramPoint | ( | const void * | P1,
|  | const void * | P2,
|  | Kind | k,
|  | const LocationContext * | l,
|  | const ProgramPointTag * | tag = `nullptr`
| ) |  |
| inline protected

Definition at line 114 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 140 of file ProgramPoint.h.

Referenced by clang::ento::CoreEngine::dispatchWorkItem(), clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(), clang::ento::StackHintGeneratorForSymbol::getMessage(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), clang::ento::ExprEngine::VisitGuardedExpr(), and clang::ento::ExprEngine::VisitLogicalExpr().

## ◆ dump()

LLVM_DUMP_METHOD void ProgramPoint::dump | ( |  | ) | const

Definition at line 46 of file ProgramPoint.cpp.

## ◆ getAs()

template<typename T >

Optional<T> clang::ProgramPoint::getAs | ( |  | ) | const
| inline

Convert to the specified ProgramPoint type, returning None if this ProgramPoint is not of the desired type.

Definition at line 151 of file ProgramPoint.h.

References clang::None.

Referenced by alreadyExecutedAtLeastOneLoopIteration(), clang::ento::CoreEngine::dispatchWorkItem(), clang::ento::CoreEngine::enqueueStmtNode(), clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(), clang::ento::ExplodedNode::getCFGBlock(), clang::ento::PathSensitiveBugReport::getLocation(), clang::ento::ExplodedNode::getLocationAs(), clang::ento::CheckerContext::getLocationRegionIfPostStore(), getLocationRegionIfReference(), clang::ento::PathSensitiveBugReport::getStmt(), clang::ento::ExplodedNode::getStmtForDiagnostics(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), clang::ento::WorkList::makeBFSBlockDFSContents(), clang::ento::WorkList::makeUnexploredFirst(), clang::ento::WorkList::makeUnexploredFirstPriorityQueue(), clang::ento::ExprEngine::VisitGuardedExpr(), and clang::ento::ExprEngine::VisitLogicalExpr().

## ◆ getData1()

const void* clang::ProgramPoint::getData1 | ( |  | ) | const
| inline protected

Definition at line 125 of file ProgramPoint.h.

## ◆ getData2()

const void* clang::ProgramPoint::getData2 | ( |  | ) | const
| inline protected

Definition at line 126 of file ProgramPoint.h.

## ◆ getHashValue()

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

Definition at line 188 of file ProgramPoint.h.

Referenced by llvm::DenseMapInfo< clang::ProgramPoint >::getHashValue().

## ◆ getKind()

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

Definition at line 160 of file ProgramPoint.h.

Referenced by clang::ento::CoreEngine::dispatchWorkItem(), and clang::ento::WorkList::enqueue().

## ◆ getLocationContext()

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

Definition at line 179 of file ProgramPoint.h.

Referenced by clang::ento::PathDiagnosticCallPiece::construct(), clang::ento::CoreEngine::ExecuteWorkListWithInitialState(), clang::ento::PathSensitiveBugReport::getLocation(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::PathSensitiveBugReport::getStmt(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), clang::ento::ExprEngine::processCFGBlockEntrance(), and clang::ento::PathDiagnosticCallPiece::setCallee().

## ◆ getProgramPoint()

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

Definition at line 21 of file ProgramPoint.cpp.

Referenced by clang::ento::CheckerManager::runCheckersForCallEvent(), and clang::ento::CheckerManager::runCheckersForEvalCall().

## ◆ getStackFrame()

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

Definition at line 183 of file ProgramPoint.h.

References clang::LocationContext::getStackFrame().

Referenced by clang::ento::ExplodedNode::getStackFrame().

## ◆ getTag()

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

Definition at line 177 of file ProgramPoint.h.

Referenced by clang::ento::CheckerContext::generateErrorNode(), clang::ento::CheckerContext::generateNonFatalErrorNode(), clang::ento::ExplodedGraph::isInterestingLValueExpr(), and clang::ento::ExprEngine::VisitObjCMessage().

## ◆ isPurgeKind()

bool clang::ProgramPoint::isPurgeKind | ( |  | ) |
| inline

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

Definition at line 171 of file ProgramPoint.h.

References getKind().

## ◆ operator!=()

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

Definition at line 201 of file ProgramPoint.h.

## ◆ operator==()

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

Definition at line 194 of file ProgramPoint.h.

## ◆ printJson()

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

Definition at line 50 of file ProgramPoint.cpp.

## ◆ Profile()

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

Definition at line 208 of file ProgramPoint.h.

References dump(), and getKind().

## ◆ setData2()

void clang::ProgramPoint::setData2 | ( | const void * | d | ) |
| inline protected

Definition at line 127 of file ProgramPoint.h.

## ◆ withTag()

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

Create a new ProgramPoint object that is the same as the original except for using the specified tag value.

Definition at line 132 of file ProgramPoint.h.

References getKind().

Referenced by clang::ento::CoreEngine::enqueueStmtNode(), clang::ento::CoreEngine::ExecuteWorkListWithInitialState(), clang::ento::NodeBuilderWithSinks::generateNode(), clang::ento::NodeBuilderWithSinks::generateSink(), and clang::ento::CheckerManager::runCheckersForEndAnalysis().

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

- include/clang/Analysis/ProgramPoint.h
- lib/Analysis/ProgramPoint.cpp