clang  14.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::ento::ExprEngine Class Reference

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

Public Types

enum  InliningModes { Inline_Regular = 0, Inline_Minimal = 0x1 }
 The modes of inlining, which override the default analysis-wide settings. More...
 

Public Member Functions

 ExprEngine (cross_tu::CrossTranslationUnitContext &CTU, AnalysisManager &mgr, SetOfConstDecls *VisitedCalleesIn, FunctionSummariesTy *FS, InliningModes HowToInlineIn)
 
virtual ~ExprEngine ()=default
 
bool ExecuteWorkList (const LocationContext *L, unsigned Steps=150000)
 Returns true if there is still simulation state on the worklist. More...
 
bool ExecuteWorkListWithInitialState (const LocationContext *L, unsigned Steps, ProgramStateRef InitState, ExplodedNodeSet &Dst)
 Execute the work list with an initial state. More...
 
ASTContextgetContext () const
 getContext - Return the ASTContext associated with this analysis. More...
 
AnalysisManagergetAnalysisManager ()
 
AnalysisDeclContextManagergetAnalysisDeclContextManager ()
 
CheckerManagergetCheckerManager () const
 
SValBuildergetSValBuilder ()
 
BugReportergetBugReporter ()
 
cross_tu::CrossTranslationUnitContextgetCrossTranslationUnitContext ()
 
const NodeBuilderContextgetBuilderContext ()
 
const StmtgetStmt () const
 
void GenerateAutoTransition (ExplodedNode *N)
 
void enqueueEndOfPath (ExplodedNodeSet &S)
 
void GenerateCallExitNode (ExplodedNode *N)
 
std::string DumpGraph (bool trim=false, StringRef Filename="")
 Dump graph to the specified filename. More...
 
std::string DumpGraph (ArrayRef< const ExplodedNode * > Nodes, StringRef Filename="")
 Dump the graph consisting of the given nodes to a specified filename. More...
 
void ViewGraph (bool trim=false)
 Visualize the ExplodedGraph created by executing the simulation. More...
 
void ViewGraph (ArrayRef< const ExplodedNode * > Nodes)
 Visualize a trimmed ExplodedGraph that only contains paths to the given nodes. More...
 
ProgramStateRef getInitialState (const LocationContext *InitLoc)
 getInitialState - Return the initial state used for the root vertex in the ExplodedGraph. More...
 
ExplodedGraphgetGraph ()
 
const ExplodedGraphgetGraph () const
 
void removeDead (ExplodedNode *Node, ExplodedNodeSet &Out, const Stmt *ReferenceStmt, const LocationContext *LC, const Stmt *DiagnosticStmt=nullptr, ProgramPoint::Kind K=ProgramPoint::PreStmtPurgeDeadSymbolsKind)
 Run the analyzer's garbage collection - remove dead symbols and bindings from the state. More...
 
void processCFGElement (const CFGElement E, ExplodedNode *Pred, unsigned StmtIdx, NodeBuilderContext *Ctx)
 processCFGElement - Called by CoreEngine. More...
 
void ProcessStmt (const Stmt *S, ExplodedNode *Pred)
 
void ProcessLoopExit (const Stmt *S, ExplodedNode *Pred)
 
void ProcessInitializer (const CFGInitializer I, ExplodedNode *Pred)
 
void ProcessImplicitDtor (const CFGImplicitDtor D, ExplodedNode *Pred)
 
void ProcessNewAllocator (const CXXNewExpr *NE, ExplodedNode *Pred)
 
void ProcessAutomaticObjDtor (const CFGAutomaticObjDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void ProcessDeleteDtor (const CFGDeleteDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void ProcessBaseDtor (const CFGBaseDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void ProcessMemberDtor (const CFGMemberDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void ProcessTemporaryDtor (const CFGTemporaryDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void processCFGBlockEntrance (const BlockEdge &L, NodeBuilderWithSinks &nodeBuilder, ExplodedNode *Pred)
 Called by CoreEngine when processing the entrance of a CFGBlock. More...
 
void processBranch (const Stmt *Condition, NodeBuilderContext &BuilderCtx, ExplodedNode *Pred, ExplodedNodeSet &Dst, const CFGBlock *DstT, const CFGBlock *DstF)
 ProcessBranch - Called by CoreEngine. More...
 
void processCleanupTemporaryBranch (const CXXBindTemporaryExpr *BTE, NodeBuilderContext &BldCtx, ExplodedNode *Pred, ExplodedNodeSet &Dst, const CFGBlock *DstT, const CFGBlock *DstF)
 Called by CoreEngine. More...
 
void processStaticInitializer (const DeclStmt *DS, NodeBuilderContext &BuilderCtx, ExplodedNode *Pred, ExplodedNodeSet &Dst, const CFGBlock *DstT, const CFGBlock *DstF)
 Called by CoreEngine. More...
 
void processIndirectGoto (IndirectGotoNodeBuilder &builder)
 processIndirectGoto - Called by CoreEngine. More...
 
void processSwitch (SwitchNodeBuilder &builder)
 ProcessSwitch - Called by CoreEngine. More...
 
void processBeginOfFunction (NodeBuilderContext &BC, ExplodedNode *Pred, ExplodedNodeSet &Dst, const BlockEdge &L)
 Called by CoreEngine. More...
 
void processEndOfFunction (NodeBuilderContext &BC, ExplodedNode *Pred, const ReturnStmt *RS=nullptr)
 Called by CoreEngine. More...
 
void removeDeadOnEndOfFunction (NodeBuilderContext &BC, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Remove dead bindings/symbols before exiting a function. More...
 
void processCallEnter (NodeBuilderContext &BC, CallEnter CE, ExplodedNode *Pred)
 Generate the entry node of the callee. More...
 
void processCallExit (ExplodedNode *Pred)
 Generate the sequence of nodes that simulate the call exit and the post visit for CallExpr. More...
 
void processEndWorklist ()
 Called by CoreEngine when the analysis worklist has terminated. More...
 
ProgramStateRef processAssume (ProgramStateRef state, SVal cond, bool assumption)
 evalAssume - Callback function invoked by the ConstraintManager when making assumptions about state values. More...
 
ProgramStateRef processRegionChanges (ProgramStateRef state, const InvalidatedSymbols *invalidated, ArrayRef< const MemRegion * > ExplicitRegions, ArrayRef< const MemRegion * > Regions, const LocationContext *LCtx, const CallEvent *Call)
 processRegionChanges - Called by ProgramStateManager whenever a change is made to the store. More...
 
ProgramStateRef processRegionChange (ProgramStateRef state, const MemRegion *MR, const LocationContext *LCtx)
 
void printJson (raw_ostream &Out, ProgramStateRef State, const LocationContext *LCtx, const char *NL, unsigned int Space, bool IsDot) const
 printJson - Called by ProgramStateManager to print checker-specific data. More...
 
ProgramStateManagergetStateManager ()
 
StoreManagergetStoreManager ()
 
ConstraintManagergetConstraintManager ()
 
BasicValueFactorygetBasicVals ()
 
SymbolManagergetSymbolManager ()
 
MemRegionManagergetRegionManager ()
 
DataTag::FactorygetDataTags ()
 
bool wasBlocksExhausted () const
 
bool hasEmptyWorkList () const
 
bool hasWorkRemaining () const
 
const CoreEnginegetCoreEngine () const
 
void Visit (const Stmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Visit - Transfer function logic for all statements. More...
 
void VisitArraySubscriptExpr (const ArraySubscriptExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitArraySubscriptExpr - Transfer function for array accesses. More...
 
void VisitGCCAsmStmt (const GCCAsmStmt *A, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitGCCAsmStmt - Transfer function logic for inline asm. More...
 
void VisitMSAsmStmt (const MSAsmStmt *A, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitMSAsmStmt - Transfer function logic for MS inline asm. More...
 
void VisitBlockExpr (const BlockExpr *BE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitBlockExpr - Transfer function logic for BlockExprs. More...
 
void VisitLambdaExpr (const LambdaExpr *LE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitLambdaExpr - Transfer function logic for LambdaExprs. More...
 
void VisitBinaryOperator (const BinaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitBinaryOperator - Transfer function logic for binary operators. More...
 
void VisitCallExpr (const CallExpr *CE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitCall - Transfer function for function calls. More...
 
void VisitCast (const CastExpr *CastE, const Expr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitCast - Transfer function logic for all casts (implicit and explicit). More...
 
void VisitCompoundLiteralExpr (const CompoundLiteralExpr *CL, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitCompoundLiteralExpr - Transfer function logic for compound literals. More...
 
void VisitCommonDeclRefExpr (const Expr *DR, const NamedDecl *D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Transfer function logic for DeclRefExprs and BlockDeclRefExprs. More...
 
void VisitDeclStmt (const DeclStmt *DS, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitDeclStmt - Transfer function logic for DeclStmts. More...
 
void VisitGuardedExpr (const Expr *Ex, const Expr *L, const Expr *R, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitGuardedExpr - Transfer function logic for ?, __builtin_choose. More...
 
void VisitInitListExpr (const InitListExpr *E, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void VisitLogicalExpr (const BinaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitLogicalExpr - Transfer function logic for '&&', '||'. More...
 
void VisitMemberExpr (const MemberExpr *M, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitMemberExpr - Transfer function for member expressions. More...
 
void VisitAtomicExpr (const AtomicExpr *E, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitAtomicExpr - Transfer function for builtin atomic expressions. More...
 
void VisitObjCAtSynchronizedStmt (const ObjCAtSynchronizedStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Transfer function logic for ObjCAtSynchronizedStmts. More...
 
void VisitLvalObjCIvarRefExpr (const ObjCIvarRefExpr *DR, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Transfer function logic for computing the lvalue of an Objective-C ivar. More...
 
void VisitObjCForCollectionStmt (const ObjCForCollectionStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitObjCForCollectionStmt - Transfer function logic for ObjCForCollectionStmt. More...
 
void VisitObjCMessage (const ObjCMessageExpr *ME, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void VisitReturnStmt (const ReturnStmt *R, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitReturnStmt - Transfer function logic for return statements. More...
 
void VisitOffsetOfExpr (const OffsetOfExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitOffsetOfExpr - Transfer function for offsetof. More...
 
void VisitUnaryExprOrTypeTraitExpr (const UnaryExprOrTypeTraitExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitUnaryExprOrTypeTraitExpr - Transfer function for sizeof. More...
 
void VisitUnaryOperator (const UnaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitUnaryOperator - Transfer function logic for unary operators. More...
 
void VisitIncrementDecrementOperator (const UnaryOperator *U, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Handle ++ and – (both pre- and post-increment). More...
 
void VisitCXXBindTemporaryExpr (const CXXBindTemporaryExpr *BTE, ExplodedNodeSet &PreVisit, ExplodedNodeSet &Dst)
 
void VisitCXXCatchStmt (const CXXCatchStmt *CS, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void VisitCXXThisExpr (const CXXThisExpr *TE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void VisitCXXConstructExpr (const CXXConstructExpr *E, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void VisitCXXInheritedCtorInitExpr (const CXXInheritedCtorInitExpr *E, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void VisitCXXDestructor (QualType ObjectType, const MemRegion *Dest, const Stmt *S, bool IsBaseDtor, ExplodedNode *Pred, ExplodedNodeSet &Dst, EvalCallOptions &Options)
 
void VisitCXXNewAllocatorCall (const CXXNewExpr *CNE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void VisitCXXNewExpr (const CXXNewExpr *CNE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void VisitCXXDeleteExpr (const CXXDeleteExpr *CDE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 
void CreateCXXTemporaryObject (const MaterializeTemporaryExpr *ME, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Create a C++ temporary object for an rvalue. More...
 
void evalEagerlyAssumeBinOpBifurcation (ExplodedNodeSet &Dst, ExplodedNodeSet &Src, const Expr *Ex)
 evalEagerlyAssumeBinOpBifurcation - Given the nodes in 'Src', eagerly assume symbolic expressions of the form 'x != 0' and generate new nodes (stored in Dst) with those assumptions. More...
 
SVal evalMinus (SVal X)
 
SVal evalComplement (SVal X)
 
ProgramStateRef handleLValueBitCast (ProgramStateRef state, const Expr *Ex, const LocationContext *LCtx, QualType T, QualType ExTy, const CastExpr *CastE, StmtNodeBuilder &Bldr, ExplodedNode *Pred)
 
ProgramStateRef handleLVectorSplat (ProgramStateRef state, const LocationContext *LCtx, const CastExpr *CastE, StmtNodeBuilder &Bldr, ExplodedNode *Pred)
 
void handleUOExtension (ExplodedNodeSet::iterator I, const UnaryOperator *U, StmtNodeBuilder &Bldr)
 
SVal evalBinOp (ProgramStateRef state, BinaryOperator::Opcode op, NonLoc L, NonLoc R, QualType T)
 
SVal evalBinOp (ProgramStateRef state, BinaryOperator::Opcode op, NonLoc L, SVal R, QualType T)
 
SVal evalBinOp (ProgramStateRef ST, BinaryOperator::Opcode Op, SVal LHS, SVal RHS, QualType T)
 
ProgramStateRef processPointerEscapedOnBind (ProgramStateRef State, ArrayRef< std::pair< SVal, SVal >> LocAndVals, const LocationContext *LCtx, PointerEscapeKind Kind, const CallEvent *Call)
 Call PointerEscape callback when a value escapes as a result of bind. More...
 
ProgramStateRef notifyCheckersOfPointerEscape (ProgramStateRef State, const InvalidatedSymbols *Invalidated, ArrayRef< const MemRegion * > ExplicitRegions, const CallEvent *Call, RegionAndSymbolInvalidationTraits &ITraits)
 Call PointerEscape callback when a value escapes as a result of region invalidation. More...
 
void evalLoad (ExplodedNodeSet &Dst, const Expr *NodeEx, const Expr *BoundExpr, ExplodedNode *Pred, ProgramStateRef St, SVal location, const ProgramPointTag *tag=nullptr, QualType LoadTy=QualType())
 Simulate a read of the result of Ex. More...
 
void evalStore (ExplodedNodeSet &Dst, const Expr *AssignE, const Expr *StoreE, ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val, const ProgramPointTag *tag=nullptr)
 evalStore - Handle the semantics of a store via an assignment. More...
 
CFGElement getCurrentCFGElement ()
 Return the CFG element corresponding to the worklist element that is currently being processed by ExprEngine. More...
 
ProgramStateRef bindReturnValue (const CallEvent &Call, const LocationContext *LCtx, ProgramStateRef State)
 Create a new state in which the call return value is binded to the call origin expression. More...
 
void evalCall (ExplodedNodeSet &Dst, ExplodedNode *Pred, const CallEvent &Call)
 Evaluate a call, running pre- and post-call checkers and allowing checkers to be responsible for handling the evaluation of the call itself. More...
 
void defaultEvalCall (NodeBuilder &B, ExplodedNode *Pred, const CallEvent &Call, const EvalCallOptions &CallOpts={})
 Default implementation of call evaluation. More...
 
SVal computeObjectUnderConstruction (const Expr *E, ProgramStateRef State, const LocationContext *LCtx, const ConstructionContext *CC, EvalCallOptions &CallOpts)
 Find location of the object that is being constructed by a given constructor. More...
 
ProgramStateRef updateObjectsUnderConstruction (SVal V, const Expr *E, ProgramStateRef State, const LocationContext *LCtx, const ConstructionContext *CC, const EvalCallOptions &CallOpts)
 Update the program state with all the path-sensitive information that's necessary to perform construction of an object with a given syntactic construction context. More...
 
std::pair< ProgramStateRef, SValhandleConstructionContext (const Expr *E, ProgramStateRef State, const LocationContext *LCtx, const ConstructionContext *CC, EvalCallOptions &CallOpts)
 A convenient wrapper around computeObjectUnderConstruction and updateObjectsUnderConstruction. More...
 

Static Public Member Functions

static std::pair< const ProgramPointTag *, const ProgramPointTag * > geteagerlyAssumeBinOpBifurcationTags ()
 
static Optional< SValgetObjectUnderConstruction (ProgramStateRef State, const ConstructionContextItem &Item, const LocationContext *LC)
 By looking at a certain item that may be potentially part of an object's ConstructionContext, retrieve such object's location. More...
 
static LLVM_NODISCARD ProgramStateRef setWhetherHasMoreIteration (ProgramStateRef State, const ObjCForCollectionStmt *O, const LocationContext *LC, bool HasMoreIteraton)
 Note whether this loop has any more iteratios to model. More...
 
static LLVM_NODISCARD ProgramStateRef removeIterationState (ProgramStateRef State, const ObjCForCollectionStmt *O, const LocationContext *LC)
 
static LLVM_NODISCARD bool hasMoreIteration (ProgramStateRef State, const ObjCForCollectionStmt *O, const LocationContext *LC)
 

Detailed Description

Definition at line 127 of file ExprEngine.h.

Member Enumeration Documentation

◆ InliningModes

The modes of inlining, which override the default analysis-wide settings.

Enumerator
Inline_Regular 

Follow the default settings for inlining callees.

Inline_Minimal 

Do minimal inlining of callees.

Definition at line 132 of file ExprEngine.h.

Constructor & Destructor Documentation

◆ ExprEngine()

ExprEngine::ExprEngine ( cross_tu::CrossTranslationUnitContext CTU,
AnalysisManager mgr,
SetOfConstDecls VisitedCalleesIn,
FunctionSummariesTy FS,
InliningModes  HowToInlineIn 
)

Definition at line 202 of file ExprEngine.cpp.

◆ ~ExprEngine()

virtual clang::ento::ExprEngine::~ExprEngine ( )
virtualdefault

Member Function Documentation

◆ bindReturnValue()

ProgramStateRef ExprEngine::bindReturnValue ( const CallEvent Call,
const LocationContext LCtx,
ProgramStateRef  State 
)

◆ computeObjectUnderConstruction()

SVal ExprEngine::computeObjectUnderConstruction ( const Expr E,
ProgramStateRef  State,
const LocationContext LCtx,
const ConstructionContext CC,
EvalCallOptions CallOpts 
)

Find location of the object that is being constructed by a given constructor.

This should ideally always succeed but due to not being fully implemented it sometimes indicates that it failed via its out-parameter CallOpts; in such cases a fake temporary region is returned, which is better than nothing but does not represent the actual behavior of the program.

Definition at line 112 of file ExprEngineCXX.cpp.

References clang::ConstructionContext::ArgumentKind, clang::ento::NodeBuilderContext::blockCount(), clang::ento::SValBuilder::conjureSymbolVal(), clang::ConstructionContext::CXX17ElidedCopyConstructorInitializerKind, clang::ConstructionContext::CXX17ElidedCopyReturnedValueKind, clang::ConstructionContext::CXX17ElidedCopyVariableKind, clang::ConstructionContext::ElidedTemporaryObjectKind, clang::ento::AnalysisManager::getAnalyzerOptions(), clang::ento::SVal::getAsRegion(), clang::ento::ProgramStateManager::getCallEventManager(), clang::StackFrameContext::getCallSite(), clang::StackFrameContext::getCallSiteBlock(), clang::ento::SValBuilder::getContext(), clang::ento::MemRegionManager::getCXXBaseObjectRegion(), clang::ento::CallEventManager::getCXXConstructorCall(), clang::ento::MemRegionManager::getCXXStaticTempObjectRegion(), clang::ento::MemRegionManager::getCXXTempObjectRegion(), clang::ento::SValBuilder::getCXXThis(), clang::LocationContext::getDecl(), clang::MaterializeTemporaryExpr::getExtendingDecl(), clang::StackFrameContext::getIndex(), clang::ConstructionContext::getKind(), clang::ento::CallEventManager::getObjCMethodCall(), getObjectUnderConstruction(), clang::LocationContext::getParent(), clang::ASTContext::getPointerType(), clang::ento::SValBuilder::getRegionManager(), clang::ento::CallEventManager::getSimpleCall(), clang::LocationContext::getStackFrame(), getStateManager(), clang::MaterializeTemporaryExpr::getStorageDuration(), getStoreManager(), getSValBuilder(), clang::Expr::getType(), clang::ento::EvalCallOptions::IsArrayCtorOrDtor, clang::ento::EvalCallOptions::IsCtorOrDtorWithImproperlyModeledTargetRegion, clang::ento::EvalCallOptions::IsElidableCtorThatHasNotBeenElided, clang::ento::EvalCallOptions::IsTemporaryCtorOrDtor, clang::ento::EvalCallOptions::IsTemporaryLifetimeExtendedViaAggregate, clang::ento::CallEvent::isVariadic(), clang::ento::SValBuilder::makeLoc(), clang::interp::NE(), clang::ConstructionContext::NewAllocatedObjectKind, clang::SD_FullExpression, clang::SD_Static, clang::SD_Thread, clang::ConstructionContext::SimpleConstructorInitializerKind, clang::ConstructionContext::SimpleReturnedValueKind, clang::ConstructionContext::SimpleTemporaryObjectKind, clang::ConstructionContext::SimpleVariableKind, State, and V.

Referenced by clang::ento::CallEvent::getReturnValueUnderConstruction(), and handleConstructionContext().

◆ CreateCXXTemporaryObject()

void ExprEngine::CreateCXXTemporaryObject ( const MaterializeTemporaryExpr ME,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ defaultEvalCall()

void ExprEngine::defaultEvalCall ( NodeBuilder B,
ExplodedNode Pred,
const CallEvent Call,
const EvalCallOptions CallOpts = {} 
)

◆ DumpGraph() [1/2]

std::string clang::ento::ExprEngine::DumpGraph ( ArrayRef< const ExplodedNode * >  Nodes,
StringRef  Filename = "" 
)

Dump the graph consisting of the given nodes to a specified filename.

Generate a temporary filename if it's not provided.

Returns
The filename the graph is written into.

◆ DumpGraph() [2/2]

std::string clang::ento::ExprEngine::DumpGraph ( bool  trim = false,
StringRef  Filename = "" 
)

Dump graph to the specified filename.

If filename is empty, generate a temporary one.

Returns
The filename the graph is written into.

Referenced by ViewGraph().

◆ enqueueEndOfPath()

void clang::ento::ExprEngine::enqueueEndOfPath ( ExplodedNodeSet S)

◆ evalBinOp() [1/3]

SVal clang::ento::ExprEngine::evalBinOp ( ProgramStateRef  ST,
BinaryOperator::Opcode  Op,
SVal  LHS,
SVal  RHS,
QualType  T 
)
inline

Definition at line 628 of file ExprEngine.h.

References clang::ento::SValBuilder::evalBinOp().

◆ evalBinOp() [2/3]

SVal clang::ento::ExprEngine::evalBinOp ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
NonLoc  L,
NonLoc  R,
QualType  T 
)
inline

Definition at line 617 of file ExprEngine.h.

References clang::ento::SValBuilder::evalBinOpNN(), and state.

Referenced by getInitialState(), and VisitLogicalExpr().

◆ evalBinOp() [3/3]

SVal clang::ento::ExprEngine::evalBinOp ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
NonLoc  L,
SVal  R,
QualType  T 
)
inline

◆ evalCall()

void ExprEngine::evalCall ( ExplodedNodeSet Dst,
ExplodedNode Pred,
const CallEvent Call 
)

◆ evalComplement()

SVal clang::ento::ExprEngine::evalComplement ( SVal  X)
inline

Definition at line 596 of file ExprEngine.h.

References clang::ento::SValBuilder::evalComplement(), and clang::tooling::X().

Referenced by VisitUnaryOperator().

◆ evalEagerlyAssumeBinOpBifurcation()

void ExprEngine::evalEagerlyAssumeBinOpBifurcation ( ExplodedNodeSet Dst,
ExplodedNodeSet Src,
const Expr Ex 
)

evalEagerlyAssumeBinOpBifurcation - Given the nodes in 'Src', eagerly assume symbolic expressions of the form 'x != 0' and generate new nodes (stored in Dst) with those assumptions.

Definition at line 3043 of file ExprEngine.cpp.

References clang::ento::StmtNodeBuilder::generateNode(), geteagerlyAssumeBinOpBifurcationTags(), clang::ento::ExplodedNode::getLocation(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::ExplodedNode::getState(), clang::StmtPoint::getStmt(), clang::Expr::getType(), clang::ento::SValBuilder::makeIntVal(), P, state, and V.

◆ evalLoad()

void ExprEngine::evalLoad ( ExplodedNodeSet Dst,
const Expr NodeEx,
const Expr BoundExpr,
ExplodedNode Pred,
ProgramStateRef  St,
SVal  location,
const ProgramPointTag tag = nullptr,
QualType  LoadTy = QualType() 
)

◆ evalMinus()

SVal clang::ento::ExprEngine::evalMinus ( SVal  X)
inline

◆ evalStore()

void ExprEngine::evalStore ( ExplodedNodeSet Dst,
const Expr AssignE,
const Expr LocationE,
ExplodedNode Pred,
ProgramStateRef  state,
SVal  location,
SVal  Val,
const ProgramPointTag tag = nullptr 
)

evalStore - Handle the semantics of a store via an assignment.

Parameters
DstThe node set to store generated state nodes
AssignEThe assignment expression if the store happens in an assignment.
LocationEThe location expression that is stored to.
stateThe current simulation state
locationThe location to store the value
ValThe value to be stored

Definition at line 2936 of file ExprEngine.cpp.

References clang::ento::ExplodedNodeSet::empty(), clang::ento::SVal::isUndef(), and state.

Referenced by VisitBinaryOperator(), and VisitIncrementDecrementOperator().

◆ ExecuteWorkList()

bool clang::ento::ExprEngine::ExecuteWorkList ( const LocationContext L,
unsigned  Steps = 150000 
)
inline

Returns true if there is still simulation state on the worklist.

Definition at line 191 of file ExprEngine.h.

References clang::ento::CoreEngine::ExecuteWorkList().

◆ ExecuteWorkListWithInitialState()

bool clang::ento::ExprEngine::ExecuteWorkListWithInitialState ( const LocationContext L,
unsigned  Steps,
ProgramStateRef  InitState,
ExplodedNodeSet Dst 
)
inline

Execute the work list with an initial state.

Nodes that reaches the exit of the function are added into the Dst set, which represent the exit state of the function call. Returns true if there is still simulation state on the worklist.

Definition at line 199 of file ExprEngine.h.

References clang::ento::CoreEngine::ExecuteWorkListWithInitialState().

◆ GenerateAutoTransition()

void clang::ento::ExprEngine::GenerateAutoTransition ( ExplodedNode N)

◆ GenerateCallExitNode()

void clang::ento::ExprEngine::GenerateCallExitNode ( ExplodedNode N)

◆ getAnalysisDeclContextManager()

AnalysisDeclContextManager& clang::ento::ExprEngine::getAnalysisDeclContextManager ( )
inline

◆ getAnalysisManager()

AnalysisManager& clang::ento::ExprEngine::getAnalysisManager ( )
inline

◆ getBasicVals()

BasicValueFactory& clang::ento::ExprEngine::getBasicVals ( )
inline

◆ getBugReporter()

BugReporter& clang::ento::ExprEngine::getBugReporter ( )
inline

◆ getBuilderContext()

const NodeBuilderContext& clang::ento::ExprEngine::getBuilderContext ( )
inline

Definition at line 227 of file ExprEngine.h.

Referenced by clang::ento::CheckerManager::runCheckersForEvalCall().

◆ getCheckerManager()

CheckerManager& clang::ento::ExprEngine::getCheckerManager ( ) const
inline

◆ getConstraintManager()

ConstraintManager& clang::ento::ExprEngine::getConstraintManager ( )
inline

◆ getContext()

ASTContext& clang::ento::ExprEngine::getContext ( ) const
inline

◆ getCoreEngine()

const CoreEngine& clang::ento::ExprEngine::getCoreEngine ( ) const
inline

Definition at line 438 of file ExprEngine.h.

Referenced by processCallExit().

◆ getCrossTranslationUnitContext()

cross_tu::CrossTranslationUnitContext* clang::ento::ExprEngine::getCrossTranslationUnitContext ( )
inline

Definition at line 223 of file ExprEngine.h.

Referenced by clang::ento::AnyFunctionCall::getRuntimeDefinition().

◆ getCurrentCFGElement()

CFGElement clang::ento::ExprEngine::getCurrentCFGElement ( )
inline

Return the CFG element corresponding to the worklist element that is currently being processed by ExprEngine.

Definition at line 699 of file ExprEngine.h.

References clang::ento::NodeBuilderContext::getBlock().

Referenced by bindReturnValue().

◆ getDataTags()

DataTag::Factory& clang::ento::ExprEngine::getDataTags ( )
inline

◆ geteagerlyAssumeBinOpBifurcationTags()

std::pair< const ProgramPointTag *, const ProgramPointTag * > ExprEngine::geteagerlyAssumeBinOpBifurcationTags ( )
static

◆ getGraph() [1/2]

ExplodedGraph& clang::ento::ExprEngine::getGraph ( )
inline

Definition at line 261 of file ExprEngine.h.

Referenced by clang::ento::PathSensitiveBugReporter::getGraph().

◆ getGraph() [2/2]

const ExplodedGraph& clang::ento::ExprEngine::getGraph ( ) const
inline

Definition at line 262 of file ExprEngine.h.

◆ getInitialState()

ProgramStateRef ExprEngine::getInitialState ( const LocationContext InitLoc)

◆ getObjectUnderConstruction()

Optional< SVal > ExprEngine::getObjectUnderConstruction ( ProgramStateRef  State,
const ConstructionContextItem Item,
const LocationContext LC 
)
static

By looking at a certain item that may be potentially part of an object's ConstructionContext, retrieve such object's location.

A particular statement can be transparently passed as Item in most cases.

Definition at line 474 of file ExprEngine.cpp.

References clang::serialized_diags::create(), clang::LocationContext::getStackFrame(), and State.

Referenced by computeObjectUnderConstruction(), clang::ento::CXXAllocatorCall::getObjectUnderConstruction(), processCleanupTemporaryBranch(), ProcessInitializer(), ProcessTemporaryDtor(), VisitCXXBindTemporaryExpr(), VisitCXXNewExpr(), and VisitDeclStmt().

◆ getRegionManager()

MemRegionManager& clang::ento::ExprEngine::getRegionManager ( )
inline

Definition at line 429 of file ExprEngine.h.

◆ getStateManager()

ProgramStateManager& clang::ento::ExprEngine::getStateManager ( )
inline

◆ getStmt()

const Stmt* clang::ento::ExprEngine::getStmt ( ) const

◆ getStoreManager()

StoreManager& clang::ento::ExprEngine::getStoreManager ( )
inline

◆ getSValBuilder()

SValBuilder& clang::ento::ExprEngine::getSValBuilder ( )
inline

◆ getSymbolManager()

SymbolManager& clang::ento::ExprEngine::getSymbolManager ( )
inline

Definition at line 428 of file ExprEngine.h.

◆ handleConstructionContext()

std::pair<ProgramStateRef, SVal> clang::ento::ExprEngine::handleConstructionContext ( const Expr E,
ProgramStateRef  State,
const LocationContext LCtx,
const ConstructionContext CC,
EvalCallOptions CallOpts 
)
inline

A convenient wrapper around computeObjectUnderConstruction and updateObjectsUnderConstruction.

Definition at line 740 of file ExprEngine.h.

References computeObjectUnderConstruction(), State, updateObjectsUnderConstruction(), and V.

Referenced by bindReturnValue().

◆ handleLValueBitCast()

ProgramStateRef ExprEngine::handleLValueBitCast ( ProgramStateRef  state,
const Expr Ex,
const LocationContext LCtx,
QualType  T,
QualType  ExTy,
const CastExpr CastE,
StmtNodeBuilder Bldr,
ExplodedNode Pred 
)

◆ handleLVectorSplat()

ProgramStateRef clang::ento::ExprEngine::handleLVectorSplat ( ProgramStateRef  state,
const LocationContext LCtx,
const CastExpr CastE,
StmtNodeBuilder Bldr,
ExplodedNode Pred 
)

◆ handleUOExtension()

void ExprEngine::handleUOExtension ( ExplodedNodeSet::iterator  I,
const UnaryOperator U,
StmtNodeBuilder Bldr 
)

Definition at line 912 of file ExprEngineC.cpp.

References clang::ento::StmtNodeBuilder::generateNode(), and state.

Referenced by VisitUnaryOperator().

◆ hasEmptyWorkList()

bool clang::ento::ExprEngine::hasEmptyWorkList ( ) const
inline

◆ hasMoreIteration()

bool ExprEngine::hasMoreIteration ( ProgramStateRef  State,
const ObjCForCollectionStmt O,
const LocationContext LC 
)
static

Definition at line 2159 of file ExprEngine.cpp.

References State.

Referenced by assumeCondition().

◆ hasWorkRemaining()

bool clang::ento::ExprEngine::hasWorkRemaining ( ) const
inline

Definition at line 436 of file ExprEngine.h.

References clang::ento::CoreEngine::hasWorkRemaining().

◆ notifyCheckersOfPointerEscape()

ProgramStateRef ExprEngine::notifyCheckersOfPointerEscape ( ProgramStateRef  State,
const InvalidatedSymbols Invalidated,
ArrayRef< const MemRegion * >  ExplicitRegions,
const CallEvent Call,
RegionAndSymbolInvalidationTraits ITraits 
)

Call PointerEscape callback when a value escapes as a result of region invalidation.

Parameters
[in]ITraitsSpecifies invalidation traits for regions/symbols.

Definition at line 2835 of file ExprEngine.cpp.

References getCheckerManager(), clang::ento::PSK_DirectEscapeOnCall, clang::ento::PSK_EscapeOther, clang::ento::PSK_IndirectEscapeOnCall, clang::ento::CheckerManager::runCheckersForPointerEscape(), and State.

◆ printJson()

void ExprEngine::printJson ( raw_ostream &  Out,
ProgramStateRef  State,
const LocationContext LCtx,
const char *  NL,
unsigned int  Space,
bool  IsDot 
) const

◆ processAssume()

ProgramStateRef ExprEngine::processAssume ( ProgramStateRef  state,
SVal  cond,
bool  assumption 
)

evalAssume - Callback function invoked by the ConstraintManager when making assumptions about state values.

evalAssume - Called by ConstraintManager.

Used to call checker-specific logic for handling assumptions on symbolic values.

Definition at line 537 of file ExprEngine.cpp.

References getCheckerManager(), clang::ento::CheckerManager::runCheckersForEvalAssume(), and state.

◆ ProcessAutomaticObjDtor()

void ExprEngine::ProcessAutomaticObjDtor ( const CFGAutomaticObjDtor  D,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ ProcessBaseDtor()

void ExprEngine::ProcessBaseDtor ( const CFGBaseDtor  D,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ processBeginOfFunction()

void ExprEngine::processBeginOfFunction ( NodeBuilderContext BC,
ExplodedNode Pred,
ExplodedNodeSet Dst,
const BlockEdge L 
)

Called by CoreEngine.

Used to notify checkers that processing a function has begun. Called for both inlined and and top-level functions.

Definition at line 2361 of file ExprEngine.cpp.

References getCheckerManager(), and clang::ento::CheckerManager::runCheckersForBeginFunction().

Referenced by clang::ento::CoreEngine::ExecuteWorkList(), and processCallEnter().

◆ processBranch()

void ExprEngine::processBranch ( const Stmt Condition,
NodeBuilderContext BuilderCtx,
ExplodedNode Pred,
ExplodedNodeSet Dst,
const CFGBlock DstT,
const CFGBlock DstF 
)

◆ processCallEnter()

void ExprEngine::processCallEnter ( NodeBuilderContext BC,
CallEnter  CE,
ExplodedNode Pred 
)

◆ processCallExit()

void ExprEngine::processCallExit ( ExplodedNode CEBNode)

Generate the sequence of nodes that simulate the call exit and the post visit for CallExpr.

The call exit is simulated with a sequence of nodes, which occur between CallExitBegin and CallExitEnd.

The following operations occur between the two program points:

  1. CallExitBegin (triggers the start of call exit sequence)
  2. Bind the return value
  3. Run Remove dead bindings to clean up the dead symbols from the callee.
  4. CallExitEnd (switch to the caller context)
  5. PostStmt<CallExpr>

Definition at line 206 of file ExprEngineCallAndReturn.cpp.

References clang::ento::ExplodedNodeSet::Add(), clang::ento::ExplodedNode::addPredecessor(), adjustReturnValue(), clang::AnalyzerOptions::AnalysisPurgeOpt, clang::ento::ExplodedNodeSet::begin(), clang::ento::SVal::castAs(), clang::ento::ExplodedNodeSet::end(), clang::ento::WorkList::enqueue(), clang::ento::SValBuilder::evalCast(), clang::LocationContext::getAnalysisDeclContext(), clang::ento::AnalysisManager::getAnalyzerOptions(), clang::AnalysisDeclContext::getBody(), clang::ento::CallEventManager::getCaller(), clang::ento::ProgramStateManager::getCallEventManager(), clang::StackFrameContext::getCallSite(), clang::StackFrameContext::getCallSiteBlock(), getCheckerManager(), getContext(), getCoreEngine(), clang::ento::SValBuilder::getCXXThis(), clang::LocationContext::getDecl(), clang::ento::CallEvent::getDeclaredResultType(), clang::StackFrameContext::getIndex(), getLastStmt(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::ExplodedGraph::getNode(), clang::LocationContext::getParent(), clang::ento::ExplodedNode::getStackFrame(), clang::LocationContext::getStackFrame(), clang::ento::ExplodedNode::getState(), getStateManager(), getStoreManager(), clang::ento::SVal::getType(), clang::ento::CoreEngine::getWorkList(), clang::ento::ExplodedNodeSet::insert(), clang::QualType::isNull(), clang::ento::AnalysisManager::options, clang::ProgramPoint::PostStmtPurgeDeadSymbolsKind, removeDead(), clang::ento::CheckerManager::runCheckersForNewAllocator(), clang::ento::CheckerManager::runCheckersForPostCall(), clang::ento::CheckerManager::runCheckersForPostObjCMessage(), clang::ento::CheckerManager::runCheckersForPostStmt(), state, clang::interp::This(), V, and wasDifferentDeclUsedForInlining().

Referenced by clang::ento::CoreEngine::dispatchWorkItem().

◆ processCFGBlockEntrance()

void ExprEngine::processCFGBlockEntrance ( const BlockEdge L,
NodeBuilderWithSinks nodeBuilder,
ExplodedNode Pred 
)

◆ processCFGElement()

void ExprEngine::processCFGElement ( const CFGElement  E,
ExplodedNode Pred,
unsigned  StmtIdx,
NodeBuilderContext Ctx 
)

◆ processCleanupTemporaryBranch()

void ExprEngine::processCleanupTemporaryBranch ( const CXXBindTemporaryExpr BTE,
NodeBuilderContext BldCtx,
ExplodedNode Pred,
ExplodedNodeSet Dst,
const CFGBlock DstT,
const CFGBlock DstF 
)

Called by CoreEngine.

Used to generate successor nodes for temporary destructors depending on whether the corresponding constructor was visited.

Definition at line 1130 of file ExprEngine.cpp.

References clang::ento::BranchNodeBuilder::generateNode(), clang::ento::ExplodedNode::getLocationContext(), getObjectUnderConstruction(), clang::ento::ExplodedNode::getState(), clang::ento::BranchNodeBuilder::markInfeasible(), and State.

◆ ProcessDeleteDtor()

void ExprEngine::ProcessDeleteDtor ( const CFGDeleteDtor  D,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ processEndOfFunction()

void ExprEngine::processEndOfFunction ( NodeBuilderContext BC,
ExplodedNode Pred,
const ReturnStmt RS = nullptr 
)

◆ processEndWorklist()

void ExprEngine::processEndWorklist ( )

Called by CoreEngine when the analysis worklist has terminated.

Definition at line 623 of file ExprEngine.cpp.

References getCheckerManager(), and clang::ento::CheckerManager::runCheckersForEndAnalysis().

Referenced by clang::ento::CoreEngine::ExecuteWorkList().

◆ ProcessImplicitDtor()

void ExprEngine::ProcessImplicitDtor ( const CFGImplicitDtor  D,
ExplodedNode Pred 
)

◆ processIndirectGoto()

void ExprEngine::processIndirectGoto ( IndirectGotoNodeBuilder builder)

◆ ProcessInitializer()

void ExprEngine::ProcessInitializer ( const CFGInitializer  I,
ExplodedNode Pred 
)

◆ ProcessLoopExit()

void ExprEngine::ProcessLoopExit ( const Stmt S,
ExplodedNode Pred 
)

Definition at line 799 of file ExprEngine.cpp.

Referenced by processCFGElement().

◆ ProcessMemberDtor()

void ExprEngine::ProcessMemberDtor ( const CFGMemberDtor  D,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ ProcessNewAllocator()

void ExprEngine::ProcessNewAllocator ( const CXXNewExpr NE,
ExplodedNode Pred 
)

◆ processPointerEscapedOnBind()

ProgramStateRef ExprEngine::processPointerEscapedOnBind ( ProgramStateRef  State,
ArrayRef< std::pair< SVal, SVal >>  LocAndVals,
const LocationContext LCtx,
PointerEscapeKind  Kind,
const CallEvent Call 
)

Call PointerEscape callback when a value escapes as a result of bind.

Definition at line 2786 of file ExprEngine.cpp.

References clang::ento::MemRegion::getBaseRegion(), clang::ento::MemRegion::hasStackStorage(), and State.

Referenced by evalCall().

◆ processRegionChange()

ProgramStateRef clang::ento::ExprEngine::processRegionChange ( ProgramStateRef  state,
const MemRegion MR,
const LocationContext LCtx 
)
inline

◆ processRegionChanges()

ProgramStateRef ExprEngine::processRegionChanges ( ProgramStateRef  state,
const InvalidatedSymbols invalidated,
ArrayRef< const MemRegion * >  ExplicitRegions,
ArrayRef< const MemRegion * >  Regions,
const LocationContext LCtx,
const CallEvent Call 
)

processRegionChanges - Called by ProgramStateManager whenever a change is made to the store.

Used to update checkers that track region values.

Definition at line 543 of file ExprEngine.cpp.

References getCheckerManager(), clang::ento::CheckerManager::runCheckersForRegionChanges(), and state.

Referenced by processRegionChange().

◆ processStaticInitializer()

void clang::ento::ExprEngine::processStaticInitializer ( const DeclStmt DS,
NodeBuilderContext BuilderCtx,
ExplodedNode Pred,
ExplodedNodeSet Dst,
const CFGBlock DstT,
const CFGBlock DstF 
)

Called by CoreEngine.

Used to processing branching behavior at static initializers.

◆ ProcessStmt()

void ExprEngine::ProcessStmt ( const Stmt S,
ExplodedNode Pred 
)

◆ processSwitch()

void ExprEngine::processSwitch ( SwitchNodeBuilder builder)

◆ ProcessTemporaryDtor()

void ExprEngine::ProcessTemporaryDtor ( const CFGTemporaryDtor  D,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ removeDead()

void ExprEngine::removeDead ( ExplodedNode Node,
ExplodedNodeSet Out,
const Stmt ReferenceStmt,
const LocationContext LC,
const Stmt DiagnosticStmt = nullptr,
ProgramPoint::Kind  K = ProgramPoint::PreStmtPurgeDeadSymbolsKind 
)

Run the analyzer's garbage collection - remove dead symbols and bindings from the state.

Checkers can participate in this process with two callbacks: checkLiveSymbols and checkDeadSymbols. See the CheckerDocumentation class for more information.

Parameters
NodeThe predecessor node, from which the processing should start.
OutThe returned set of output nodes.
ReferenceStmtThe statement which is about to be processed. Everything needed for this statement should be considered live. A null statement means that everything in child LocationContexts is dead.
LCThe location context of the ReferenceStmt. A null location context means that we have reached the end of analysis and that all statements and local variables should be considered dead.
DiagnosticStmtUsed as a location for any warnings that should occur while removing the dead (e.g. leaks). By default, the ReferenceStmt is used.
KDenotes whether this is a pre- or post-statement purge. This must only be ProgramPoint::PostStmtPurgeDeadSymbolsKind if an entire location context is being cleared, in which case the ReferenceStmt must either be a ReturnStmt or NULL. Otherwise, it must be ProgramPoint::PreStmtPurgeDeadSymbolsKind (the default) and ReferenceStmt must be valid (non-null).

Definition at line 689 of file ExprEngine.cpp.

References clang::ento::StmtNodeBuilder::generateNode(), getCheckerManager(), getConstraintManager(), clang::LocationContext::getParent(), clang::LocationContext::getStackFrame(), clang::ento::ExplodedNode::getState(), getStoreManager(), clang::ento::SymbolReaper::markLive(), clang::ProgramPoint::PostStmtPurgeDeadSymbolsKind, clang::ProgramPoint::PreStmtPurgeDeadSymbolsKind, clang::ento::ConstraintManager::removeDeadBindings(), clang::ento::CheckerManager::runCheckersForDeadSymbols(), and clang::ento::CheckerManager::runCheckersForLiveSymbols().

Referenced by processCallExit(), ProcessStmt(), and removeDeadOnEndOfFunction().

◆ removeDeadOnEndOfFunction()

void ExprEngine::removeDeadOnEndOfFunction ( NodeBuilderContext BC,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ removeIterationState()

ProgramStateRef ExprEngine::removeIterationState ( ProgramStateRef  State,
const ObjCForCollectionStmt O,
const LocationContext LC 
)
static

Definition at line 2152 of file ExprEngine.cpp.

References State.

Referenced by assumeCondition().

◆ setWhetherHasMoreIteration()

ProgramStateRef ExprEngine::setWhetherHasMoreIteration ( ProgramStateRef  State,
const ObjCForCollectionStmt O,
const LocationContext LC,
bool  HasMoreIteraton 
)
static

Note whether this loop has any more iteratios to model.

These methods are essentially an interface for a GDM trait. Further reading in ExprEngine::VisitObjCForCollectionStmt().

Definition at line 2144 of file ExprEngine.cpp.

References State.

◆ updateObjectsUnderConstruction()

ProgramStateRef ExprEngine::updateObjectsUnderConstruction ( SVal  V,
const Expr E,
ProgramStateRef  State,
const LocationContext LCtx,
const ConstructionContext CC,
const EvalCallOptions CallOpts 
)

◆ ViewGraph() [1/2]

void ExprEngine::ViewGraph ( ArrayRef< const ExplodedNode * >  Nodes)

Visualize a trimmed ExplodedGraph that only contains paths to the given nodes.

Definition at line 3227 of file ExprEngine.cpp.

References DumpGraph(), Filename, Nodes, and string().

◆ ViewGraph() [2/2]

void clang::ento::ExprEngine::ViewGraph ( bool  trim = false)

Visualize the ExplodedGraph created by executing the simulation.

◆ Visit()

void ExprEngine::Visit ( const Stmt S,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

Visit - Transfer function logic for all statements.

Dispatches to other functions that handle specific kinds of statements.

Definition at line 1202 of file ExprEngine.cpp.

Referenced by ProcessStmt().

◆ VisitArraySubscriptExpr()

void ExprEngine::VisitArraySubscriptExpr ( const ArraySubscriptExpr Ex,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitAtomicExpr()

void ExprEngine::VisitAtomicExpr ( const AtomicExpr E,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitBinaryOperator()

void ExprEngine::VisitBinaryOperator ( const BinaryOperator B,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitBlockExpr()

void ExprEngine::VisitBlockExpr ( const BlockExpr BE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCallExpr()

void ExprEngine::VisitCallExpr ( const CallExpr CE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCast()

void ExprEngine::VisitCast ( const CastExpr CastE,
const Expr Ex,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCommonDeclRefExpr()

void ExprEngine::VisitCommonDeclRefExpr ( const Expr DR,
const NamedDecl D,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCompoundLiteralExpr()

void ExprEngine::VisitCompoundLiteralExpr ( const CompoundLiteralExpr CL,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCXXBindTemporaryExpr()

void ExprEngine::VisitCXXBindTemporaryExpr ( const CXXBindTemporaryExpr BTE,
ExplodedNodeSet PreVisit,
ExplodedNodeSet Dst 
)

◆ VisitCXXCatchStmt()

void ExprEngine::VisitCXXCatchStmt ( const CXXCatchStmt CS,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCXXConstructExpr()

void ExprEngine::VisitCXXConstructExpr ( const CXXConstructExpr E,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

Definition at line 686 of file ExprEngineCXX.cpp.

◆ VisitCXXDeleteExpr()

void ExprEngine::VisitCXXDeleteExpr ( const CXXDeleteExpr CDE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCXXDestructor()

void ExprEngine::VisitCXXDestructor ( QualType  ObjectType,
const MemRegion Dest,
const Stmt S,
bool  IsBaseDtor,
ExplodedNode Pred,
ExplodedNodeSet Dst,
EvalCallOptions Options 
)

◆ VisitCXXInheritedCtorInitExpr()

void ExprEngine::VisitCXXInheritedCtorInitExpr ( const CXXInheritedCtorInitExpr E,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

Definition at line 692 of file ExprEngineCXX.cpp.

◆ VisitCXXNewAllocatorCall()

void ExprEngine::VisitCXXNewAllocatorCall ( const CXXNewExpr CNE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCXXNewExpr()

void ExprEngine::VisitCXXNewExpr ( const CXXNewExpr CNE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitCXXThisExpr()

void ExprEngine::VisitCXXThisExpr ( const CXXThisExpr TE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitDeclStmt()

void ExprEngine::VisitDeclStmt ( const DeclStmt DS,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitGCCAsmStmt()

void ExprEngine::VisitGCCAsmStmt ( const GCCAsmStmt A,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitGuardedExpr()

void ExprEngine::VisitGuardedExpr ( const Expr Ex,
const Expr L,
const Expr R,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitIncrementDecrementOperator()

void ExprEngine::VisitIncrementDecrementOperator ( const UnaryOperator U,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitInitListExpr()

void ExprEngine::VisitInitListExpr ( const InitListExpr E,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitLambdaExpr()

void ExprEngine::VisitLambdaExpr ( const LambdaExpr LE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitLogicalExpr()

void ExprEngine::VisitLogicalExpr ( const BinaryOperator B,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitLvalObjCIvarRefExpr()

void ExprEngine::VisitLvalObjCIvarRefExpr ( const ObjCIvarRefExpr DR,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitMemberExpr()

void ExprEngine::VisitMemberExpr ( const MemberExpr M,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitMSAsmStmt()

void ExprEngine::VisitMSAsmStmt ( const MSAsmStmt A,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

VisitMSAsmStmt - Transfer function logic for MS inline asm.

Definition at line 3107 of file ExprEngine.cpp.

References clang::ento::StmtNodeBuilder::generateNode(), and clang::ento::ExplodedNode::getState().

◆ VisitObjCAtSynchronizedStmt()

void ExprEngine::VisitObjCAtSynchronizedStmt ( const ObjCAtSynchronizedStmt S,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

Transfer function logic for ObjCAtSynchronizedStmts.

Definition at line 38 of file ExprEngineObjC.cpp.

◆ VisitObjCForCollectionStmt()

void ExprEngine::VisitObjCForCollectionStmt ( const ObjCForCollectionStmt S,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

VisitObjCForCollectionStmt - Transfer function logic for ObjCForCollectionStmt.

Definition at line 83 of file ExprEngineObjC.cpp.

◆ VisitObjCMessage()

void ExprEngine::VisitObjCMessage ( const ObjCMessageExpr ME,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitOffsetOfExpr()

void ExprEngine::VisitOffsetOfExpr ( const OffsetOfExpr Ex,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

VisitOffsetOfExpr - Transfer function for offsetof.

Definition at line 851 of file ExprEngineC.cpp.

◆ VisitReturnStmt()

void ExprEngine::VisitReturnStmt ( const ReturnStmt R,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitUnaryExprOrTypeTraitExpr()

void ExprEngine::VisitUnaryExprOrTypeTraitExpr ( const UnaryExprOrTypeTraitExpr Ex,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ VisitUnaryOperator()

void ExprEngine::VisitUnaryOperator ( const UnaryOperator B,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

◆ wasBlocksExhausted()

bool clang::ento::ExprEngine::wasBlocksExhausted ( ) const
inline

Definition at line 434 of file ExprEngine.h.

References clang::ento::CoreEngine::wasBlocksExhausted().


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