clang API Documentation

Public Member Functions | Protected Member Functions
clang::ento::ExprEngine Class Reference

#include <ExprEngine.h>

Inheritance diagram for clang::ento::ExprEngine:
Inheritance graph
[legend]
Collaboration diagram for clang::ento::ExprEngine:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ExprEngine (AnalysisManager &mgr, bool gcEnabled, SetOfConstDecls *VisitedCallees, FunctionSummariesTy *FS)
 ~ExprEngine ()
bool ExecuteWorkList (const LocationContext *L, unsigned Steps=150000)
 Returns true if there is still simulation state on the worklist.
bool ExecuteWorkListWithInitialState (const LocationContext *L, unsigned Steps, ProgramStateRef InitState, ExplodedNodeSet &Dst)
ASTContextgetContext () const
 getContext - Return the ASTContext associated with this analysis.
virtual AnalysisManagergetAnalysisManager ()
CheckerManagergetCheckerManager () const
SValBuildergetSValBuilder ()
BugReportergetBugReporter ()
const NodeBuilderContextgetBuilderContext ()
bool isObjCGCEnabled ()
const StmtgetStmt () const
void GenerateAutoTransition (ExplodedNode *N)
void enqueueEndOfPath (ExplodedNodeSet &S)
void GenerateCallExitNode (ExplodedNode *N)
void ViewGraph (bool trim=false)
void ViewGraph (ExplodedNode **Beg, ExplodedNode **End)
ProgramStateRef getInitialState (const LocationContext *InitLoc)
ExplodedGraphgetGraph ()
const ExplodedGraphgetGraph () const
void removeDead (ExplodedNode *Node, ExplodedNodeSet &Out, const Stmt *ReferenceStmt, const LocationContext *LC, const Stmt *DiagnosticStmt, ProgramPoint::Kind K=ProgramPoint::PreStmtPurgeDeadSymbolsKind)
 Run the analyzer's garbage collection - remove dead symbols and bindings.
void processCFGElement (const CFGElement E, ExplodedNode *Pred, unsigned StmtIdx, NodeBuilderContext *Ctx)
void ProcessStmt (const CFGStmt S, ExplodedNode *Pred)
void ProcessInitializer (const CFGInitializer I, ExplodedNode *Pred)
void ProcessImplicitDtor (const CFGImplicitDtor D, ExplodedNode *Pred)
void ProcessAutomaticObjDtor (const CFGAutomaticObjDtor 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)
virtual void processCFGBlockEntrance (const BlockEdge &L, NodeBuilderWithSinks &nodeBuilder)
 Called by CoreEngine when processing the entrance of a CFGBlock.
void processBranch (const Stmt *Condition, const Stmt *Term, NodeBuilderContext &BuilderCtx, ExplodedNode *Pred, ExplodedNodeSet &Dst, const CFGBlock *DstT, const CFGBlock *DstF)
void processIndirectGoto (IndirectGotoNodeBuilder &builder)
void processSwitch (SwitchNodeBuilder &builder)
void processEndOfFunction (NodeBuilderContext &BC)
void processCallEnter (CallEnter CE, ExplodedNode *Pred)
 Generate the entry node of the callee.
void processCallExit (ExplodedNode *Pred)
void processEndWorklist (bool hasWorkRemaining)
 Called by CoreEngine when the analysis worklist has terminated.
ProgramStateRef processAssume (ProgramStateRef state, SVal cond, bool assumption)
bool wantsRegionChangeUpdate (ProgramStateRef state)
ProgramStateRef processRegionChanges (ProgramStateRef state, const StoreManager::InvalidatedSymbols *invalidated, ArrayRef< const MemRegion * > ExplicitRegions, ArrayRef< const MemRegion * > Regions, const CallOrObjCMessage *Call)
void printState (raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep)
 printState - Called by ProgramStateManager to print checker-specific data.
virtual ProgramStateManagergetStateManager ()
StoreManagergetStoreManager ()
ConstraintManagergetConstraintManager ()
BasicValueFactorygetBasicVals ()
const BasicValueFactorygetBasicVals () const
SymbolManagergetSymbolManager ()
const SymbolManagergetSymbolManager () const
bool wasBlocksExhausted () const
bool hasEmptyWorkList () const
bool hasWorkRemaining () const
const CoreEnginegetCoreEngine () const
void Visit (const Stmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitLvalArraySubscriptExpr (const ArraySubscriptExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitArraySubscriptExpr - Transfer function for array accesses.
void VisitAsmStmt (const AsmStmt *A, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitAsmStmt - Transfer function logic for inline asm.
void VisitBlockExpr (const BlockExpr *BE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitBlockExpr - Transfer function logic for BlockExprs.
void VisitBinaryOperator (const BinaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitBinaryOperator - Transfer function logic for binary operators.
void VisitCallExpr (const CallExpr *CE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitCall - Transfer function for function calls.
void VisitCast (const CastExpr *CastE, const Expr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitCast - Transfer function logic for all casts (implicit and explicit).
void VisitCompoundLiteralExpr (const CompoundLiteralExpr *CL, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitCompoundLiteralExpr - Transfer function logic for compound literals.
void VisitCommonDeclRefExpr (const Expr *DR, const NamedDecl *D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Transfer function logic for DeclRefExprs and BlockDeclRefExprs.
void VisitDeclStmt (const DeclStmt *DS, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitDeclStmt - Transfer function logic for DeclStmts.
void VisitGuardedExpr (const Expr *Ex, const Expr *L, const Expr *R, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitGuardedExpr - Transfer function logic for ?, __builtin_choose.
void VisitInitListExpr (const InitListExpr *E, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitLogicalExpr (const BinaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitLogicalExpr - Transfer function logic for '&&', '||'.
void VisitMemberExpr (const MemberExpr *M, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitMemberExpr - Transfer function for member expressions.
void VisitObjCAtSynchronizedStmt (const ObjCAtSynchronizedStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Transfer function logic for ObjCAtSynchronizedStmts.
void VisitLvalObjCIvarRefExpr (const ObjCIvarRefExpr *DR, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Transfer function logic for computing the lvalue of an Objective-C ivar.
void VisitObjCForCollectionStmt (const ObjCForCollectionStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitObjCMessage (const ObjCMessage &msg, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitReturnStmt (const ReturnStmt *R, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitReturnStmt - Transfer function logic for return statements.
void VisitOffsetOfExpr (const OffsetOfExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitOffsetOfExpr - Transfer function for offsetof.
void VisitUnaryExprOrTypeTraitExpr (const UnaryExprOrTypeTraitExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitUnaryExprOrTypeTraitExpr - Transfer function for sizeof.
void VisitUnaryOperator (const UnaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 VisitUnaryOperator - Transfer function logic for unary operators.
void VisitIncrementDecrementOperator (const UnaryOperator *U, ExplodedNode *Pred, ExplodedNodeSet &Dst)
 Handle ++ and -- (both pre- and post-increment).
void VisitCXXCatchStmt (const CXXCatchStmt *CS, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitCXXThisExpr (const CXXThisExpr *TE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitCXXTemporaryObjectExpr (const CXXTemporaryObjectExpr *expr, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitCXXConstructExpr (const CXXConstructExpr *E, const MemRegion *Dest, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitCXXDestructor (const CXXDestructorDecl *DD, const MemRegion *Dest, const Stmt *S, 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.
const CXXThisRegiongetCXXThisRegion (const CXXRecordDecl *RD, const StackFrameContext *SFC)
 Synthesize CXXThisRegion.
const CXXThisRegiongetCXXThisRegion (const CXXMethodDecl *decl, const StackFrameContext *frameCtx)
void evalEagerlyAssume (ExplodedNodeSet &Dst, ExplodedNodeSet &Src, const Expr *Ex)
std::pair< const
ProgramPointTag *, const
ProgramPointTag * > 
getEagerlyAssumeTags ()
SVal evalMinus (SVal X)
SVal evalComplement (SVal X)
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)
void evalLoad (ExplodedNodeSet &Dst, const Expr *NodeEx, const Expr *BoundExpr, ExplodedNode *Pred, ProgramStateRef St, SVal location, const ProgramPointTag *tag=0, QualType LoadTy=QualType())
 Simulate a read of the result of Ex.
void evalStore (ExplodedNodeSet &Dst, const Expr *AssignE, const Expr *StoreE, ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val, const ProgramPointTag *tag=0)

Protected Member Functions

void evalObjCMessage (StmtNodeBuilder &Bldr, const ObjCMessage &msg, ExplodedNode *Pred, ProgramStateRef state, bool GenSink)
ProgramStateRef invalidateArguments (ProgramStateRef State, const CallOrObjCMessage &Call, const LocationContext *LC)
ProgramStateRef MarkBranch (ProgramStateRef state, const Stmt *Terminator, const LocationContext *LCtx, bool branchTaken)
void evalBind (ExplodedNodeSet &Dst, const Stmt *StoreE, ExplodedNode *Pred, SVal location, SVal Val, bool atDeclInit=false)

Detailed Description

Definition at line 47 of file ExprEngine.h.


Constructor & Destructor Documentation

ExprEngine::ExprEngine ( AnalysisManager mgr,
bool  gcEnabled,
SetOfConstDecls VisitedCallees,
FunctionSummariesTy FS 
)
ExprEngine::~ExprEngine ( )

Definition at line 91 of file ExprEngine.cpp.

References clang::ento::BugReporter::FlushReports().


Member Function Documentation

void ExprEngine::CreateCXXTemporaryObject ( const MaterializeTemporaryExpr ME,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void clang::ento::ExprEngine::enqueueEndOfPath ( ExplodedNodeSet S)
void ExprEngine::evalBind ( ExplodedNodeSet Dst,
const Stmt StoreE,
ExplodedNode Pred,
SVal  location,
SVal  Val,
bool  atDeclInit = false 
) [protected]

evalBind - Handle the semantics of binding a value to a specific location. This method is used by evalStore, VisitDeclStmt, and others.

evalBind - Handle the semantics of binding a value to a specific location. This method is used by evalStore and (soon) VisitDeclStmt, and others.

Definition at line 1552 of file ExprEngine.cpp.

References clang::ento::ExplodedNodeSet::begin(), clang::ento::ExplodedNodeSet::end(), clang::ento::StmtNodeBuilder::generateNode(), getCheckerManager(), clang::ento::ExplodedNode::getLocationContext(), clang::ento::ExplodedNode::getState(), clang::ento::ExplodedNodeSet::insert(), clang::ProgramPoint::PostStmtKind, and clang::ento::CheckerManager::runCheckersForBind().

Referenced by evalStore(), and VisitDeclStmt().

SVal clang::ento::ExprEngine::evalBinOp ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
NonLoc  L,
NonLoc  R,
QualType  T 
) [inline]
SVal clang::ento::ExprEngine::evalBinOp ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
NonLoc  L,
SVal  R,
QualType  T 
) [inline]
SVal clang::ento::ExprEngine::evalBinOp ( ProgramStateRef  ST,
BinaryOperator::Opcode  Op,
SVal  LHS,
SVal  RHS,
QualType  T 
) [inline]

Definition at line 433 of file ExprEngine.h.

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

SVal clang::ento::ExprEngine::evalComplement ( SVal  X) [inline]
void ExprEngine::evalEagerlyAssume ( ExplodedNodeSet Dst,
ExplodedNodeSet Src,
const Expr Ex 
)
void ExprEngine::evalLoad ( ExplodedNodeSet Dst,
const Expr NodeEx,
const Expr BoundExpr,
ExplodedNode Pred,
ProgramStateRef  St,
SVal  location,
const ProgramPointTag tag = 0,
QualType  LoadTy = QualType() 
)
SVal clang::ento::ExprEngine::evalMinus ( SVal  X) [inline]
void ExprEngine::evalObjCMessage ( StmtNodeBuilder Bldr,
const ObjCMessage msg,
ExplodedNode Pred,
ProgramStateRef  state,
bool  GenSink 
) [protected]
void ExprEngine::evalStore ( ExplodedNodeSet Dst,
const Expr AssignE,
const Expr LocationE,
ExplodedNode Pred,
ProgramStateRef  state,
SVal  location,
SVal  Val,
const ProgramPointTag tag = 0 
)

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.
LocatioinEThe location expression that is stored to.
stateThe current simulation state
locationThe location to store the value
ValThe value to be stored

Definition at line 1599 of file ExprEngine.cpp.

References clang::ento::ExplodedNodeSet::begin(), clang::ento::ExplodedNodeSet::empty(), clang::ento::ExplodedNodeSet::end(), evalBind(), and clang::ento::SVal::isUndef().

Referenced by VisitIncrementDecrementOperator().

bool CoreEngine::ExecuteWorkList ( const LocationContext L,
unsigned  Steps = 150000 
) [inline]

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

ExecuteWorkList - Run the worklist algorithm for a maximum number of steps.

Definition at line 101 of file ExprEngine.h.

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

bool CoreEngine::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 109 of file ExprEngine.h.

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

void clang::ento::ExprEngine::GenerateAutoTransition ( ExplodedNode N)
void clang::ento::ExprEngine::GenerateCallExitNode ( ExplodedNode N)
virtual AnalysisManager& clang::ento::ExprEngine::getAnalysisManager ( ) [inline, virtual]

Implements clang::ento::SubEngine.

Definition at line 118 of file ExprEngine.h.

Referenced by clang::ento::CheckerContext::getAnalysisManager().

BasicValueFactory& clang::ento::ExprEngine::getBasicVals ( ) [inline]
const BasicValueFactory& clang::ento::ExprEngine::getBasicVals ( ) const [inline]

Definition at line 261 of file ExprEngine.h.

References clang::ento::ProgramStateManager::getBasicVals().

BugReporter& clang::ento::ExprEngine::getBugReporter ( ) [inline]
const NodeBuilderContext& clang::ento::ExprEngine::getBuilderContext ( ) [inline]

Definition at line 128 of file ExprEngine.h.

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

CheckerManager& clang::ento::ExprEngine::getCheckerManager ( ) const [inline]
ConstraintManager& clang::ento::ExprEngine::getConstraintManager ( ) [inline]
ASTContext& clang::ento::ExprEngine::getContext ( ) const [inline]
const CoreEngine& clang::ento::ExprEngine::getCoreEngine ( ) const [inline]

Definition at line 274 of file ExprEngine.h.

Referenced by clang::ento::SubEngine::processCallExit().

const CXXThisRegion* clang::ento::ExprEngine::getCXXThisRegion ( const CXXRecordDecl RD,
const StackFrameContext SFC 
)
const CXXThisRegion * ExprEngine::getCXXThisRegion ( const CXXMethodDecl decl,
const StackFrameContext frameCtx 
)
std::pair< const ProgramPointTag *, const ProgramPointTag * > ExprEngine::getEagerlyAssumeTags ( )

Definition at line 1747 of file ExprEngine.cpp.

Referenced by evalEagerlyAssume().

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

Definition at line 151 of file ExprEngine.h.

ExplodedGraph & GRBugReporter::getGraph ( ) const [inline]

Definition at line 152 of file ExprEngine.h.

ProgramStateRef clang::ento::ExprEngine::getInitialState ( const LocationContext InitLoc) [virtual]

getInitialState - Return the initial state used for the root vertex in the ExplodedGraph.

Implements clang::ento::SubEngine.

virtual ProgramStateManager& clang::ento::ExprEngine::getStateManager ( ) [inline, virtual]
const Stmt* clang::ento::ExprEngine::getStmt ( ) const

Referenced by evalEagerlyAssume().

StoreManager& clang::ento::ExprEngine::getStoreManager ( ) [inline]
SValBuilder& clang::ento::ExprEngine::getSValBuilder ( ) [inline]

Definition at line 124 of file ExprEngine.h.

Referenced by evalObjCMessage(), and clang::ento::CheckerContext::getSValBuilder().

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

Definition at line 266 of file ExprEngine.h.

const SymbolManager& clang::ento::ExprEngine::getSymbolManager ( ) const [inline]

Definition at line 267 of file ExprEngine.h.

bool clang::ento::ExprEngine::hasEmptyWorkList ( ) const [inline]
bool clang::ento::ExprEngine::hasWorkRemaining ( ) const [inline]

Definition at line 272 of file ExprEngine.h.

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

ProgramStateRef ExprEngine::invalidateArguments ( ProgramStateRef  State,
const CallOrObjCMessage Call,
const LocationContext LC 
) [protected]
bool clang::ento::ExprEngine::isObjCGCEnabled ( ) [inline]

Definition at line 133 of file ExprEngine.h.

Referenced by clang::ento::CheckerContext::isObjCGCEnabled().

ProgramStateRef ExprEngine::MarkBranch ( ProgramStateRef  state,
const Stmt Terminator,
const LocationContext LCtx,
bool  branchTaken 
) [protected]
void clang::ento::ExprEngine::printState ( raw_ostream &  Out,
ProgramStateRef  State,
const char *  NL,
const char *  Sep 
) [virtual]

printState - Called by ProgramStateManager to print checker-specific data.

Implements clang::ento::SubEngine.

ProgramStateRef clang::ento::ExprEngine::processAssume ( ProgramStateRef  state,
SVal  cond,
bool  assumption 
) [virtual]

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

Implements clang::ento::SubEngine.

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

Definition at line 461 of file ExprEngine.cpp.

Referenced by ProcessImplicitDtor().

void clang::ento::ExprEngine::processBranch ( const Stmt Condition,
const Stmt Term,
NodeBuilderContext BuilderCtx,
ExplodedNode Pred,
ExplodedNodeSet Dst,
const CFGBlock DstT,
const CFGBlock DstF 
) [virtual]

ProcessBranch - Called by CoreEngine. Used to generate successor nodes by processing the 'effects' of a branch condition.

Implements clang::ento::SubEngine.

void clang::ento::ExprEngine::processCallEnter ( CallEnter  CE,
ExplodedNode Pred 
) [virtual]

Generate the entry node of the callee.

Implements clang::ento::SubEngine.

void clang::ento::ExprEngine::processCallExit ( ExplodedNode Pred) [virtual]

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

Implements clang::ento::SubEngine.

virtual void clang::ento::ExprEngine::processCFGBlockEntrance ( const BlockEdge L,
NodeBuilderWithSinks nodeBuilder 
) [virtual]

Called by CoreEngine when processing the entrance of a CFGBlock.

Implements clang::ento::SubEngine.

void clang::ento::ExprEngine::processCFGElement ( const CFGElement  E,
ExplodedNode Pred,
unsigned  StmtIdx,
NodeBuilderContext Ctx 
) [virtual]

processCFGElement - Called by CoreEngine. Used to generate new successor nodes by processing the 'effects' of a CFG element.

Implements clang::ento::SubEngine.

void clang::ento::ExprEngine::processEndOfFunction ( NodeBuilderContext BC) [virtual]

ProcessEndPath - Called by CoreEngine. Used to generate end-of-path nodes when the control reaches the end of a function.

Implements clang::ento::SubEngine.

void clang::ento::ExprEngine::processEndWorklist ( bool  hasWorkRemaining) [virtual]

Called by CoreEngine when the analysis worklist has terminated.

Implements clang::ento::SubEngine.

void ExprEngine::ProcessImplicitDtor ( const CFGImplicitDtor  D,
ExplodedNode Pred 
)
void clang::ento::ExprEngine::processIndirectGoto ( IndirectGotoNodeBuilder builder) [virtual]

processIndirectGoto - Called by CoreEngine. Used to generate successor nodes by processing the 'effects' of a computed goto jump.

Implements clang::ento::SubEngine.

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

Definition at line 464 of file ExprEngine.cpp.

Referenced by ProcessImplicitDtor().

ProgramStateRef clang::ento::ExprEngine::processRegionChanges ( ProgramStateRef  state,
const StoreManager::InvalidatedSymbols invalidated,
ArrayRef< const MemRegion * >  ExplicitRegions,
ArrayRef< const MemRegion * >  Regions,
const CallOrObjCMessage Call 
) [virtual]

processRegionChanges - Called by ProgramStateManager whenever a change is made to the store. Used to update checkers that track region values.

Implements clang::ento::SubEngine.

void ExprEngine::ProcessStmt ( const CFGStmt  S,
ExplodedNode Pred 
)
void clang::ento::ExprEngine::processSwitch ( SwitchNodeBuilder builder) [virtual]

ProcessSwitch - Called by CoreEngine. Used to generate successor nodes by processing the 'effects' of a switch statement.

Implements clang::ento::SubEngine.

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

Definition at line 467 of file ExprEngine.cpp.

Referenced by ProcessImplicitDtor().

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

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

Parameters:
Node- The predecessor node, from which the processing should start.
Out- The returned set of output nodes.
ReferenceStmt- Run garbage collection using the symbols, which are live before the given statement.
LC- The location context of the ReferenceStmt.
DiagnosticStmt- the statement used to associate the diagnostic message, if any warnings should occur while removing the dead (leaks are usually reported here).
K- In some cases it is possible to use PreStmt kind. (Do not use it unless you know what you are doing.)

Definition at line 262 of file ExprEngine.cpp.

References clang::ento::ExplodedNodeSet::begin(), clang::ento::ExplodedNodeSet::end(), clang::ento::StmtNodeBuilder::generateNode(), getCheckerManager(), getConstraintManager(), clang::LocationContext::getCurrentStackFrame(), clang::ento::ProgramStateManager::getPersistentStateWithGDM(), clang::ento::ExplodedNode::getState(), getStoreManager(), clang::ento::SymbolReaper::hasDeadSymbols(), clang::ento::ProgramStateManager::haveEqualEnvironments(), clang::ento::ProgramStateManager::haveEqualStores(), clang::ProgramPoint::PreStmtPurgeDeadSymbolsKind, clang::ento::ConstraintManager::removeDeadBindings(), clang::ento::ProgramStateManager::removeDeadBindings(), clang::ento::CheckerManager::runCheckersForDeadSymbols(), and clang::ento::CheckerManager::runCheckersForLiveSymbols().

Referenced by clang::ento::SubEngine::processCallExit(), and ProcessStmt().

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

ViewGraph - Visualize the ExplodedGraph created by executing the simulation.

Referenced by ViewGraph().

void ExprEngine::ViewGraph ( ExplodedNode **  Beg,
ExplodedNode **  End 
)
void clang::ento::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.

Referenced by ProcessStmt().

void ExprEngine::VisitAsmStmt ( const AsmStmt A,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void clang::ento::ExprEngine::VisitBinaryOperator ( const BinaryOperator B,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

VisitBinaryOperator - Transfer function logic for binary operators.

void ExprEngine::VisitBlockExpr ( const BlockExpr BE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCallExpr ( const CallExpr CE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCast ( const CastExpr CastE,
const Expr Ex,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

VisitCast - Transfer function logic for all casts (implicit and explicit).

Definition at line 221 of file ExprEngineC.cpp.

References clang::ento::ExplodedNodeSet::begin(), clang::CK_AnyPointerToBlockPointerCast, clang::CK_ARCConsumeObject, clang::CK_ARCExtendBlockObject, clang::CK_ARCProduceObject, clang::CK_ARCReclaimReturnedObject, clang::CK_ArrayToPointerDecay, clang::CK_AtomicToNonAtomic, clang::CK_BaseToDerived, clang::CK_BaseToDerivedMemberPointer, clang::CK_BitCast, clang::CK_BlockPointerToObjCPointerCast, clang::CK_ConstructorConversion, clang::CK_CopyAndAutoreleaseBlockObject, clang::CK_CPointerToObjCPointerCast, clang::CK_Dependent, clang::CK_DerivedToBase, clang::CK_DerivedToBaseMemberPointer, clang::CK_Dynamic, clang::CK_FloatingCast, clang::CK_FloatingComplexCast, clang::CK_FloatingComplexToBoolean, clang::CK_FloatingComplexToIntegralComplex, clang::CK_FloatingComplexToReal, clang::CK_FloatingRealToComplex, clang::CK_FloatingToBoolean, clang::CK_FloatingToIntegral, clang::CK_FunctionToPointerDecay, clang::CK_IntegralCast, clang::CK_IntegralComplexCast, clang::CK_IntegralComplexToBoolean, clang::CK_IntegralComplexToFloatingComplex, clang::CK_IntegralComplexToReal, clang::CK_IntegralRealToComplex, clang::CK_IntegralToBoolean, clang::CK_IntegralToFloating, clang::CK_IntegralToPointer, clang::CK_LValueBitCast, clang::CK_LValueToRValue, clang::CK_MemberPointerToBoolean, clang::CK_NonAtomicToAtomic, clang::CK_NoOp, clang::CK_NullToMemberPointer, clang::CK_NullToPointer, clang::CK_ObjCObjectLValueCast, clang::CK_PointerToBoolean, clang::CK_PointerToIntegral, clang::CK_ReinterpretMemberPointer, clang::CK_ToUnion, clang::CK_ToVoid, clang::CK_UncheckedDerivedToBase, clang::CK_UserDefinedConversion, clang::CK_VectorSplat, clang::ento::ExplodedNodeSet::end(), clang::ento::SValBuilder::evalCast(), clang::ento::StoreManager::evalDerivedToBase(), clang::ento::StoreManager::evalDynamicCast(), evalLoad(), clang::ento::StmtNodeBuilder::generateNode(), clang::CastExpr::getCastKind(), getCheckerManager(), clang::ento::SValBuilder::getConjuredSymbolVal(), getContext(), clang::ento::NodeBuilderContext::getCurrentBlockCount(), clang::ento::ExplodedNode::getLocationContext(), clang::ASTContext::getPointerType(), clang::ento::ExplodedNode::getState(), getStoreManager(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::ento::SVal::isUnknown(), clang::ento::SVal::isZeroConstant(), clang::ento::SValBuilder::makeNull(), NULL, and clang::ento::CheckerManager::runCheckersForPreStmt().

void ExprEngine::VisitCommonDeclRefExpr ( const Expr DR,
const NamedDecl D,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCompoundLiteralExpr ( const CompoundLiteralExpr CL,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCXXCatchStmt ( const CXXCatchStmt CS,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCXXConstructExpr ( const CXXConstructExpr E,
const MemRegion Dest,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCXXDeleteExpr ( const CXXDeleteExpr CDE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCXXDestructor ( const CXXDestructorDecl DD,
const MemRegion Dest,
const Stmt S,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCXXNewExpr ( const CXXNewExpr CNE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitCXXTemporaryObjectExpr ( const CXXTemporaryObjectExpr expr,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

Definition at line 56 of file ExprEngineCXX.cpp.

References VisitCXXConstructExpr().

void ExprEngine::VisitCXXThisExpr ( const CXXThisExpr TE,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitDeclStmt ( const DeclStmt DS,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitGuardedExpr ( const Expr Ex,
const Expr L,
const Expr R,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

VisitGuardedExpr - Transfer function logic for ?, __builtin_choose.

Definition at line 577 of file ExprEngineC.cpp.

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

void ExprEngine::VisitIncrementDecrementOperator ( const UnaryOperator U,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitInitListExpr ( const InitListExpr E,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitLogicalExpr ( const BinaryOperator B,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitLvalArraySubscriptExpr ( const ArraySubscriptExpr Ex,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitLvalObjCIvarRefExpr ( const ObjCIvarRefExpr DR,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitMemberExpr ( const MemberExpr M,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitObjCAtSynchronizedStmt ( const ObjCAtSynchronizedStmt S,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

Transfer function logic for ObjCAtSynchronizedStmts.

Definition at line 39 of file ExprEngineObjC.cpp.

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

void ExprEngine::VisitObjCForCollectionStmt ( const ObjCForCollectionStmt S,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitObjCMessage ( const ObjCMessage msg,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitOffsetOfExpr ( const OffsetOfExpr Ex,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void ExprEngine::VisitReturnStmt ( const ReturnStmt R,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)
void clang::ento::ExprEngine::VisitUnaryExprOrTypeTraitExpr ( const UnaryExprOrTypeTraitExpr Ex,
ExplodedNode Pred,
ExplodedNodeSet Dst 
)

VisitUnaryExprOrTypeTraitExpr - Transfer function for sizeof.

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

VisitUnaryOperator - Transfer function logic for unary operators.

bool clang::ento::ExprEngine::wantsRegionChangeUpdate ( ProgramStateRef  state) [virtual]

wantsRegionChangeUpdate - Called by ProgramStateManager to determine if a region change should trigger a processRegionChanges update.

Implements clang::ento::SubEngine.

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

Definition at line 270 of file ExprEngine.h.

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


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