clang  6.0.0svn
ExprEngine.h
Go to the documentation of this file.
1 //===-- ExprEngine.h - Path-Sensitive Expression-Level Dataflow ---*- C++ -*-=//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines a meta-engine for path-sensitive dataflow analysis that
11 // is built on CoreEngine, but provides the boilerplate to execute transfer
12 // functions and build the ExplodedGraph at the expression level.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H
17 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H
18 
19 #include "clang/AST/Expr.h"
20 #include "clang/AST/Type.h"
28 
29 namespace clang {
30 
31 class AnalysisDeclContextManager;
32 class CXXCatchStmt;
33 class CXXConstructExpr;
34 class CXXDeleteExpr;
35 class CXXNewExpr;
36 class CXXTemporaryObjectExpr;
37 class CXXThisExpr;
38 class MaterializeTemporaryExpr;
39 class ObjCAtSynchronizedStmt;
40 class ObjCForCollectionStmt;
41 
42 namespace ento {
43 
44 class AnalysisManager;
45 class CallEvent;
46 class CXXConstructorCall;
47 
48 class ExprEngine : public SubEngine {
49 public:
50  /// The modes of inlining, which override the default analysis-wide settings.
52  /// Follow the default settings for inlining callees.
54  /// Do minimal inlining of callees.
56  };
57 
58 private:
59  AnalysisManager &AMgr;
60 
61  AnalysisDeclContextManager &AnalysisDeclContexts;
62 
63  CoreEngine Engine;
64 
65  /// G - the simulation graph.
66  ExplodedGraph& G;
67 
68  /// StateMgr - Object that manages the data for all created states.
69  ProgramStateManager StateMgr;
70 
71  /// SymMgr - Object that manages the symbol information.
72  SymbolManager& SymMgr;
73 
74  /// svalBuilder - SValBuilder object that creates SVals from expressions.
75  SValBuilder &svalBuilder;
76 
77  unsigned int currStmtIdx;
78  const NodeBuilderContext *currBldrCtx;
79 
80  /// Helper object to determine if an Objective-C message expression
81  /// implicitly never returns.
82  ObjCNoReturn ObjCNoRet;
83 
84  /// Whether or not GC is enabled in this analysis.
85  bool ObjCGCEnabled;
86 
87  /// The BugReporter associated with this engine. It is important that
88  /// this object be placed at the very end of member variables so that its
89  /// destructor is called before the rest of the ExprEngine is destroyed.
90  GRBugReporter BR;
91 
92  /// The functions which have been analyzed through inlining. This is owned by
93  /// AnalysisConsumer. It can be null.
94  SetOfConstDecls *VisitedCallees;
95 
96  /// The flag, which specifies the mode of inlining for the engine.
97  InliningModes HowToInline;
98 
99 public:
100  ExprEngine(AnalysisManager &mgr, bool gcEnabled,
101  SetOfConstDecls *VisitedCalleesIn,
103  InliningModes HowToInlineIn);
104 
105  ~ExprEngine() override;
106 
107  /// Returns true if there is still simulation state on the worklist.
108  bool ExecuteWorkList(const LocationContext *L, unsigned Steps = 150000) {
109  return Engine.ExecuteWorkList(L, Steps, nullptr);
110  }
111 
112  /// Execute the work list with an initial state. Nodes that reaches the exit
113  /// of the function are added into the Dst set, which represent the exit
114  /// state of the function call. Returns true if there is still simulation
115  /// state on the worklist.
116  bool ExecuteWorkListWithInitialState(const LocationContext *L, unsigned Steps,
117  ProgramStateRef InitState,
118  ExplodedNodeSet &Dst) {
119  return Engine.ExecuteWorkListWithInitialState(L, Steps, InitState, Dst);
120  }
121 
122  /// getContext - Return the ASTContext associated with this analysis.
123  ASTContext &getContext() const { return AMgr.getASTContext(); }
124 
125  AnalysisManager &getAnalysisManager() override { return AMgr; }
126 
128  return *AMgr.getCheckerManager();
129  }
130 
131  SValBuilder &getSValBuilder() { return svalBuilder; }
132 
133  BugReporter& getBugReporter() { return BR; }
134 
136  assert(currBldrCtx);
137  return *currBldrCtx;
138  }
139 
140  bool isObjCGCEnabled() { return ObjCGCEnabled; }
141 
142  const Stmt *getStmt() const;
143 
147 
148  /// Visualize the ExplodedGraph created by executing the simulation.
149  void ViewGraph(bool trim = false);
150 
151  /// Visualize a trimmed ExplodedGraph that only contains paths to the given
152  /// nodes.
154 
155  /// getInitialState - Return the initial state used for the root vertex
156  /// in the ExplodedGraph.
157  ProgramStateRef getInitialState(const LocationContext *InitLoc) override;
158 
159  ExplodedGraph& getGraph() { return G; }
160  const ExplodedGraph& getGraph() const { return G; }
161 
162  /// \brief Run the analyzer's garbage collection - remove dead symbols and
163  /// bindings from the state.
164  ///
165  /// Checkers can participate in this process with two callbacks:
166  /// \c checkLiveSymbols and \c checkDeadSymbols. See the CheckerDocumentation
167  /// class for more information.
168  ///
169  /// \param Node The predecessor node, from which the processing should start.
170  /// \param Out The returned set of output nodes.
171  /// \param ReferenceStmt The statement which is about to be processed.
172  /// Everything needed for this statement should be considered live.
173  /// A null statement means that everything in child LocationContexts
174  /// is dead.
175  /// \param LC The location context of the \p ReferenceStmt. A null location
176  /// context means that we have reached the end of analysis and that
177  /// all statements and local variables should be considered dead.
178  /// \param DiagnosticStmt Used as a location for any warnings that should
179  /// occur while removing the dead (e.g. leaks). By default, the
180  /// \p ReferenceStmt is used.
181  /// \param K Denotes whether this is a pre- or post-statement purge. This
182  /// must only be ProgramPoint::PostStmtPurgeDeadSymbolsKind if an
183  /// entire location context is being cleared, in which case the
184  /// \p ReferenceStmt must either be a ReturnStmt or \c NULL. Otherwise,
185  /// it must be ProgramPoint::PreStmtPurgeDeadSymbolsKind (the default)
186  /// and \p ReferenceStmt must be valid (non-null).
188  const Stmt *ReferenceStmt, const LocationContext *LC,
189  const Stmt *DiagnosticStmt = nullptr,
191 
192  /// processCFGElement - Called by CoreEngine. Used to generate new successor
193  /// nodes by processing the 'effects' of a CFG element.
194  void processCFGElement(const CFGElement E, ExplodedNode *Pred,
195  unsigned StmtIdx, NodeBuilderContext *Ctx) override;
196 
197  void ProcessStmt(const CFGStmt S, ExplodedNode *Pred);
198 
199  void ProcessLoopExit(const Stmt* S, ExplodedNode *Pred);
200 
201  void ProcessInitializer(const CFGInitializer I, ExplodedNode *Pred);
202 
203  void ProcessImplicitDtor(const CFGImplicitDtor D, ExplodedNode *Pred);
204 
205  void ProcessNewAllocator(const CXXNewExpr *NE, ExplodedNode *Pred);
206 
208  ExplodedNode *Pred, ExplodedNodeSet &Dst);
209  void ProcessDeleteDtor(const CFGDeleteDtor D,
210  ExplodedNode *Pred, ExplodedNodeSet &Dst);
211  void ProcessBaseDtor(const CFGBaseDtor D,
212  ExplodedNode *Pred, ExplodedNodeSet &Dst);
213  void ProcessMemberDtor(const CFGMemberDtor D,
214  ExplodedNode *Pred, ExplodedNodeSet &Dst);
216  ExplodedNode *Pred, ExplodedNodeSet &Dst);
217 
218  /// Called by CoreEngine when processing the entrance of a CFGBlock.
219  void processCFGBlockEntrance(const BlockEdge &L,
220  NodeBuilderWithSinks &nodeBuilder,
221  ExplodedNode *Pred) override;
222 
223  /// ProcessBranch - Called by CoreEngine. Used to generate successor
224  /// nodes by processing the 'effects' of a branch condition.
225  void processBranch(const Stmt *Condition, const Stmt *Term,
226  NodeBuilderContext& BuilderCtx,
227  ExplodedNode *Pred,
228  ExplodedNodeSet &Dst,
229  const CFGBlock *DstT,
230  const CFGBlock *DstF) override;
231 
232  /// Called by CoreEngine.
233  /// Used to generate successor nodes for temporary destructors depending
234  /// on whether the corresponding constructor was visited.
236  NodeBuilderContext &BldCtx,
237  ExplodedNode *Pred, ExplodedNodeSet &Dst,
238  const CFGBlock *DstT,
239  const CFGBlock *DstF) override;
240 
241  /// Called by CoreEngine. Used to processing branching behavior
242  /// at static initializers.
243  void processStaticInitializer(const DeclStmt *DS,
244  NodeBuilderContext& BuilderCtx,
245  ExplodedNode *Pred,
246  ExplodedNodeSet &Dst,
247  const CFGBlock *DstT,
248  const CFGBlock *DstF) override;
249 
250  /// processIndirectGoto - Called by CoreEngine. Used to generate successor
251  /// nodes by processing the 'effects' of a computed goto jump.
252  void processIndirectGoto(IndirectGotoNodeBuilder& builder) override;
253 
254  /// ProcessSwitch - Called by CoreEngine. Used to generate successor
255  /// nodes by processing the 'effects' of a switch statement.
256  void processSwitch(SwitchNodeBuilder& builder) override;
257 
258  /// Called by CoreEngine. Used to notify checkers that processing a
259  /// function has begun. Called for both inlined and and top-level functions.
261  ExplodedNode *Pred, ExplodedNodeSet &Dst,
262  const BlockEdge &L) override;
263 
264  /// Called by CoreEngine. Used to notify checkers that processing a
265  /// function has ended. Called for both inlined and and top-level functions.
267  ExplodedNode *Pred,
268  const ReturnStmt *RS = nullptr) override;
269 
270  /// Remove dead bindings/symbols before exiting a function.
272  ExplodedNode *Pred,
273  ExplodedNodeSet &Dst);
274 
275  /// Generate the entry node of the callee.
277  ExplodedNode *Pred) override;
278 
279  /// Generate the sequence of nodes that simulate the call exit and the post
280  /// visit for CallExpr.
281  void processCallExit(ExplodedNode *Pred) override;
282 
283  /// Called by CoreEngine when the analysis worklist has terminated.
284  void processEndWorklist(bool hasWorkRemaining) override;
285 
286  /// evalAssume - Callback function invoked by the ConstraintManager when
287  /// making assumptions about state values.
289  bool assumption) override;
290 
291  /// processRegionChanges - Called by ProgramStateManager whenever a change is made
292  /// to the store. Used to update checkers that track region values.
295  const InvalidatedSymbols *invalidated,
296  ArrayRef<const MemRegion *> ExplicitRegions,
298  const LocationContext *LCtx,
299  const CallEvent *Call) override;
300 
301  /// printState - Called by ProgramStateManager to print checker-specific data.
302  void printState(raw_ostream &Out, ProgramStateRef State,
303  const char *NL, const char *Sep) override;
304 
305  ProgramStateManager& getStateManager() override { return StateMgr; }
306 
307  StoreManager& getStoreManager() { return StateMgr.getStoreManager(); }
308 
310  return StateMgr.getConstraintManager();
311  }
312 
313  // FIXME: Remove when we migrate over to just using SValBuilder.
315  return StateMgr.getBasicVals();
316  }
317 
318  // FIXME: Remove when we migrate over to just using ValueManager.
319  SymbolManager& getSymbolManager() { return SymMgr; }
320  const SymbolManager& getSymbolManager() const { return SymMgr; }
321 
322  // Functions for external checking of whether we have unfinished work
323  bool wasBlocksExhausted() const { return Engine.wasBlocksExhausted(); }
324  bool hasEmptyWorkList() const { return !Engine.getWorkList()->hasWork(); }
325  bool hasWorkRemaining() const { return Engine.hasWorkRemaining(); }
326 
327  const CoreEngine &getCoreEngine() const { return Engine; }
328 
329 public:
330  /// Visit - Transfer function logic for all statements. Dispatches to
331  /// other functions that handle specific kinds of statements.
332  void Visit(const Stmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst);
333 
334  /// VisitArraySubscriptExpr - Transfer function for array accesses.
336  ExplodedNode *Pred,
337  ExplodedNodeSet &Dst);
338 
339  /// VisitGCCAsmStmt - Transfer function logic for inline asm.
340  void VisitGCCAsmStmt(const GCCAsmStmt *A, ExplodedNode *Pred,
341  ExplodedNodeSet &Dst);
342 
343  /// VisitMSAsmStmt - Transfer function logic for MS inline asm.
344  void VisitMSAsmStmt(const MSAsmStmt *A, ExplodedNode *Pred,
345  ExplodedNodeSet &Dst);
346 
347  /// VisitBlockExpr - Transfer function logic for BlockExprs.
348  void VisitBlockExpr(const BlockExpr *BE, ExplodedNode *Pred,
349  ExplodedNodeSet &Dst);
350 
351  /// VisitLambdaExpr - Transfer function logic for LambdaExprs.
352  void VisitLambdaExpr(const LambdaExpr *LE, ExplodedNode *Pred,
353  ExplodedNodeSet &Dst);
354 
355  /// VisitBinaryOperator - Transfer function logic for binary operators.
356  void VisitBinaryOperator(const BinaryOperator* B, ExplodedNode *Pred,
357  ExplodedNodeSet &Dst);
358 
359 
360  /// VisitCall - Transfer function for function calls.
361  void VisitCallExpr(const CallExpr *CE, ExplodedNode *Pred,
362  ExplodedNodeSet &Dst);
363 
364  /// VisitCast - Transfer function logic for all casts (implicit and explicit).
365  void VisitCast(const CastExpr *CastE, const Expr *Ex, ExplodedNode *Pred,
366  ExplodedNodeSet &Dst);
367 
368  /// VisitCompoundLiteralExpr - Transfer function logic for compound literals.
370  ExplodedNode *Pred, ExplodedNodeSet &Dst);
371 
372  /// Transfer function logic for DeclRefExprs and BlockDeclRefExprs.
373  void VisitCommonDeclRefExpr(const Expr *DR, const NamedDecl *D,
374  ExplodedNode *Pred, ExplodedNodeSet &Dst);
375 
376  /// VisitDeclStmt - Transfer function logic for DeclStmts.
377  void VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred,
378  ExplodedNodeSet &Dst);
379 
380  /// VisitGuardedExpr - Transfer function logic for ?, __builtin_choose
381  void VisitGuardedExpr(const Expr *Ex, const Expr *L, const Expr *R,
382  ExplodedNode *Pred, ExplodedNodeSet &Dst);
383 
384  void VisitInitListExpr(const InitListExpr *E, ExplodedNode *Pred,
385  ExplodedNodeSet &Dst);
386 
387  /// VisitLogicalExpr - Transfer function logic for '&&', '||'
388  void VisitLogicalExpr(const BinaryOperator* B, ExplodedNode *Pred,
389  ExplodedNodeSet &Dst);
390 
391  /// VisitMemberExpr - Transfer function for member expressions.
392  void VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred,
393  ExplodedNodeSet &Dst);
394 
395  /// VisitMemberExpr - Transfer function for builtin atomic expressions
396  void VisitAtomicExpr(const AtomicExpr *E, ExplodedNode *Pred,
397  ExplodedNodeSet &Dst);
398 
399  /// Transfer function logic for ObjCAtSynchronizedStmts.
401  ExplodedNode *Pred, ExplodedNodeSet &Dst);
402 
403  /// Transfer function logic for computing the lvalue of an Objective-C ivar.
405  ExplodedNodeSet &Dst);
406 
407  /// VisitObjCForCollectionStmt - Transfer function logic for
408  /// ObjCForCollectionStmt.
410  ExplodedNode *Pred, ExplodedNodeSet &Dst);
411 
412  void VisitObjCMessage(const ObjCMessageExpr *ME, ExplodedNode *Pred,
413  ExplodedNodeSet &Dst);
414 
415  /// VisitReturnStmt - Transfer function logic for return statements.
416  void VisitReturnStmt(const ReturnStmt *R, ExplodedNode *Pred,
417  ExplodedNodeSet &Dst);
418 
419  /// VisitOffsetOfExpr - Transfer function for offsetof.
420  void VisitOffsetOfExpr(const OffsetOfExpr *Ex, ExplodedNode *Pred,
421  ExplodedNodeSet &Dst);
422 
423  /// VisitUnaryExprOrTypeTraitExpr - Transfer function for sizeof.
425  ExplodedNode *Pred, ExplodedNodeSet &Dst);
426 
427  /// VisitUnaryOperator - Transfer function logic for unary operators.
428  void VisitUnaryOperator(const UnaryOperator* B, ExplodedNode *Pred,
429  ExplodedNodeSet &Dst);
430 
431  /// Handle ++ and -- (both pre- and post-increment).
433  ExplodedNode *Pred,
434  ExplodedNodeSet &Dst);
435 
437  ExplodedNodeSet &PreVisit,
438  ExplodedNodeSet &Dst);
439 
440  void VisitCXXCatchStmt(const CXXCatchStmt *CS, ExplodedNode *Pred,
441  ExplodedNodeSet &Dst);
442 
443  void VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred,
444  ExplodedNodeSet & Dst);
445 
447  ExplodedNodeSet &Dst);
448 
449  void VisitCXXDestructor(QualType ObjectType, const MemRegion *Dest,
450  const Stmt *S, bool IsBaseDtor,
451  ExplodedNode *Pred, ExplodedNodeSet &Dst);
452 
453  void VisitCXXNewAllocatorCall(const CXXNewExpr *CNE,
454  ExplodedNode *Pred,
455  ExplodedNodeSet &Dst);
456 
457  void VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred,
458  ExplodedNodeSet &Dst);
459 
460  void VisitCXXDeleteExpr(const CXXDeleteExpr *CDE, ExplodedNode *Pred,
461  ExplodedNodeSet &Dst);
462 
463  /// Create a C++ temporary object for an rvalue.
465  ExplodedNode *Pred,
466  ExplodedNodeSet &Dst);
467 
468  /// evalEagerlyAssumeBinOpBifurcation - Given the nodes in 'Src', eagerly assume symbolic
469  /// expressions of the form 'x != 0' and generate new nodes (stored in Dst)
470  /// with those assumptions.
472  const Expr *Ex);
473 
474  std::pair<const ProgramPointTag *, const ProgramPointTag*>
476 
478  return X.isValid() ? svalBuilder.evalMinus(X.castAs<NonLoc>()) : X;
479  }
480 
482  return X.isValid() ? svalBuilder.evalComplement(X.castAs<NonLoc>()) : X;
483  }
484 
486  const LocationContext *LCtx, QualType T,
487  QualType ExTy, const CastExpr *CastE,
488  StmtNodeBuilder &Bldr,
489  ExplodedNode *Pred);
490 
492  const LocationContext *LCtx,
493  const CastExpr *CastE,
494  StmtNodeBuilder &Bldr,
495  ExplodedNode *Pred);
496 
498  const UnaryOperator* U,
499  StmtNodeBuilder &Bldr);
500 
501 public:
502 
504  NonLoc L, NonLoc R, QualType T) {
505  return svalBuilder.evalBinOpNN(state, op, L, R, T);
506  }
507 
509  NonLoc L, SVal R, QualType T) {
510  return R.isValid() ? svalBuilder.evalBinOpNN(state, op, L,
511  R.castAs<NonLoc>(), T) : R;
512  }
513 
515  SVal LHS, SVal RHS, QualType T) {
516  return svalBuilder.evalBinOp(ST, Op, LHS, RHS, T);
517  }
518 
519 protected:
520  /// evalBind - Handle the semantics of binding a value to a specific location.
521  /// This method is used by evalStore, VisitDeclStmt, and others.
522  void evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE, ExplodedNode *Pred,
523  SVal location, SVal Val, bool atDeclInit = false,
524  const ProgramPoint *PP = nullptr);
525 
526  /// Call PointerEscape callback when a value escapes as a result of bind.
528  SVal Loc,
529  SVal Val,
530  const LocationContext *LCtx) override;
531  /// Call PointerEscape callback when a value escapes as a result of
532  /// region invalidation.
533  /// \param[in] ITraits Specifies invalidation traits for regions/symbols.
535  ProgramStateRef State,
536  const InvalidatedSymbols *Invalidated,
537  ArrayRef<const MemRegion *> ExplicitRegions,
539  const CallEvent *Call,
540  RegionAndSymbolInvalidationTraits &ITraits) override;
541 
542 public:
543  // FIXME: 'tag' should be removed, and a LocationContext should be used
544  // instead.
545  // FIXME: Comment on the meaning of the arguments, when 'St' may not
546  // be the same as Pred->state, and when 'location' may not be the
547  // same as state->getLValue(Ex).
548  /// Simulate a read of the result of Ex.
549  void evalLoad(ExplodedNodeSet &Dst,
550  const Expr *NodeEx, /* Eventually will be a CFGStmt */
551  const Expr *BoundExpr,
552  ExplodedNode *Pred,
553  ProgramStateRef St,
554  SVal location,
555  const ProgramPointTag *tag = nullptr,
556  QualType LoadTy = QualType());
557 
558  // FIXME: 'tag' should be removed, and a LocationContext should be used
559  // instead.
560  void evalStore(ExplodedNodeSet &Dst, const Expr *AssignE, const Expr *StoreE,
561  ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val,
562  const ProgramPointTag *tag = nullptr);
563 
564  /// \brief Create a new state in which the call return value is binded to the
565  /// call origin expression.
567  const LocationContext *LCtx,
568  ProgramStateRef State);
569 
570  /// Evaluate a call, running pre- and post-call checks and allowing checkers
571  /// to be responsible for handling the evaluation of the call itself.
572  void evalCall(ExplodedNodeSet &Dst, ExplodedNode *Pred,
573  const CallEvent &Call);
574 
575  /// \brief Default implementation of call evaluation.
577  const CallEvent &Call);
578 private:
579  void evalLoadCommon(ExplodedNodeSet &Dst,
580  const Expr *NodeEx, /* Eventually will be a CFGStmt */
581  const Expr *BoundEx,
582  ExplodedNode *Pred,
583  ProgramStateRef St,
584  SVal location,
585  const ProgramPointTag *tag,
586  QualType LoadTy);
587 
588  // FIXME: 'tag' should be removed, and a LocationContext should be used
589  // instead.
590  void evalLocation(ExplodedNodeSet &Dst,
591  const Stmt *NodeEx, /* This will eventually be a CFGStmt */
592  const Stmt *BoundEx,
593  ExplodedNode *Pred,
594  ProgramStateRef St, SVal location,
595  const ProgramPointTag *tag, bool isLoad);
596 
597  /// Count the stack depth and determine if the call is recursive.
598  void examineStackFrames(const Decl *D, const LocationContext *LCtx,
599  bool &IsRecursive, unsigned &StackDepth);
600 
601  /// Checks our policies and decides weither the given call should be inlined.
602  bool shouldInlineCall(const CallEvent &Call, const Decl *D,
603  const ExplodedNode *Pred);
604 
605  bool inlineCall(const CallEvent &Call, const Decl *D, NodeBuilder &Bldr,
606  ExplodedNode *Pred, ProgramStateRef State);
607 
608  /// \brief Conservatively evaluate call by invalidating regions and binding
609  /// a conjured return value.
610  void conservativeEvalCall(const CallEvent &Call, NodeBuilder &Bldr,
611  ExplodedNode *Pred, ProgramStateRef State);
612 
613  /// \brief Either inline or process the call conservatively (or both), based
614  /// on DynamicDispatchBifurcation data.
615  void BifurcateCall(const MemRegion *BifurReg,
616  const CallEvent &Call, const Decl *D, NodeBuilder &Bldr,
617  ExplodedNode *Pred);
618 
619  bool replayWithoutInlining(ExplodedNode *P, const LocationContext *CalleeLC);
620 
621  /// Models a trivial copy or move constructor or trivial assignment operator
622  /// call with a simple bind.
623  void performTrivialCopy(NodeBuilder &Bldr, ExplodedNode *Pred,
624  const CallEvent &Call);
625 
626  /// If the value of the given expression \p InitWithAdjustments is a NonLoc,
627  /// copy it into a new temporary object region, and replace the value of the
628  /// expression with that.
629  ///
630  /// If \p Result is provided, the new region will be bound to this expression
631  /// instead of \p InitWithAdjustments.
632  ProgramStateRef createTemporaryRegionIfNeeded(ProgramStateRef State,
633  const LocationContext *LC,
634  const Expr *InitWithAdjustments,
635  const Expr *Result = nullptr);
636 
637  /// For a DeclStmt or CXXInitCtorInitializer, walk backward in the current CFG
638  /// block to find the constructor expression that directly constructed into
639  /// the storage for this statement. Returns null if the constructor for this
640  /// statement created a temporary object region rather than directly
641  /// constructing into an existing region.
642  const CXXConstructExpr *findDirectConstructorForCurrentCFGElement();
643 
644  /// For a CXXConstructExpr, walk forward in the current CFG block to find the
645  /// CFGElement for the DeclStmt or CXXInitCtorInitializer for which is
646  /// directly constructed by this constructor. Returns None if the current
647  /// constructor expression did not directly construct into an existing
648  /// region.
649  Optional<CFGElement> findElementDirectlyInitializedByCurrentConstructor();
650 
651  /// For a given constructor, look forward in the current CFG block to
652  /// determine the region into which an object will be constructed by \p CE.
653  /// Returns either a field or local variable region if the object will be
654  /// directly constructed in an existing region or a temporary object region
655  /// if not.
656  const MemRegion *getRegionForConstructedObject(const CXXConstructExpr *CE,
657  ExplodedNode *Pred);
658 };
659 
660 /// Traits for storing the call processing policy inside GDM.
661 /// The GDM stores the corresponding CallExpr pointer.
662 // FIXME: This does not use the nice trait macros because it must be accessible
663 // from multiple translation units.
665 template <>
667  public ProgramStatePartialTrait<const void*> {
668  static void *GDMIndex() { static int index = 0; return &index; }
669 };
670 
671 } // end ento namespace
672 
673 } // end clang namespace
674 
675 #endif
This represents a GCC inline-assembly statement extension.
Definition: Stmt.h:1616
void ProcessInitializer(const CFGInitializer I, ExplodedNode *Pred)
Definition: ExprEngine.cpp:533
A (possibly-)qualified type.
Definition: Type.h:614
MemRegion - The root abstract class for all memory regions.
Definition: MemRegion.h:79
ProgramStateRef notifyCheckersOfPointerEscape(ProgramStateRef State, const InvalidatedSymbols *Invalidated, ArrayRef< const MemRegion *> ExplicitRegions, ArrayRef< const MemRegion *> Regions, const CallEvent *Call, RegionAndSymbolInvalidationTraits &ITraits) override
Call PointerEscape callback when a value escapes as a result of region invalidation.
CheckerManager * getCheckerManager() const
void VisitCallExpr(const CallExpr *CE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitCall - Transfer function for function calls.
void processCallExit(ExplodedNode *Pred) override
Generate the sequence of nodes that simulate the call exit and the post visit for CallExpr...
bool ExecuteWorkList(const LocationContext *L, unsigned Steps, ProgramStateRef InitState)
ExecuteWorkList - Run the worklist algorithm for a maximum number of steps.
Definition: CoreEngine.cpp:164
Stmt - This represents one statement.
Definition: Stmt.h:66
Information about invalidation for a particular region/symbol.
Definition: MemRegion.h:1383
BasicValueFactory & getBasicVals()
Definition: ProgramState.h:503
This builder class is useful for generating nodes that resulted from visiting a statement.
Definition: CoreEngine.h:349
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE, ExplodedNodeSet &PreVisit, ExplodedNodeSet &Dst)
Definition: ExprEngine.cpp:804
C Language Family Type Representation.
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
void VisitMSAsmStmt(const MSAsmStmt *A, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitMSAsmStmt - Transfer function logic for MS inline asm.
Represents a point when we begin processing an inlined call.
Definition: ProgramPoint.h:585
void printState(raw_ostream &Out, ProgramStateRef State, const char *NL, const char *Sep) override
printState - Called by ProgramStateManager to print checker-specific data.
Definition: ExprEngine.cpp:334
StringRef P
bool ExecuteWorkListWithInitialState(const LocationContext *L, unsigned Steps, ProgramStateRef InitState, ExplodedNodeSet &Dst)
Execute the work list with an initial state.
Definition: ExprEngine.h:116
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, NonLoc L, NonLoc R, QualType T)
Definition: ExprEngine.h:503
void processCleanupTemporaryBranch(const CXXBindTemporaryExpr *BTE, NodeBuilderContext &BldCtx, ExplodedNode *Pred, ExplodedNodeSet &Dst, const CFGBlock *DstT, const CFGBlock *DstF) override
Called by CoreEngine.
Definition: ExprEngine.cpp:787
CFGDeleteDtor - Represents C++ object destructor generated from a call to delete. ...
Definition: CFG.h:266
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1177
void ProcessMemberDtor(const CFGMemberDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Definition: ExprEngine.cpp:743
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
Definition: ExprCXX.h:3951
void processCFGBlockEntrance(const BlockEdge &L, NodeBuilderWithSinks &nodeBuilder, ExplodedNode *Pred) override
Called by CoreEngine when processing the entrance of a CFGBlock.
ProgramStateRef getInitialState(const LocationContext *InitLoc) override
getInitialState - Return the initial state used for the root vertex in the ExplodedGraph.
Definition: ExprEngine.cpp:106
void VisitUnaryOperator(const UnaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitUnaryOperator - Transfer function logic for unary operators.
void handleUOExtension(ExplodedNodeSet::iterator I, const UnaryOperator *U, StmtNodeBuilder &Bldr)
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:2702
void ProcessDeleteDtor(const CFGDeleteDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Definition: ExprEngine.cpp:695
const NodeBuilderContext & getBuilderContext()
Definition: ExprEngine.h:135
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.
bool ExecuteWorkListWithInitialState(const LocationContext *L, unsigned Steps, ProgramStateRef InitState, ExplodedNodeSet &Dst)
Returns true if there is still simulation state on the worklist.
Definition: CoreEngine.cpp:284
void removeDead(ExplodedNode *Node, ExplodedNodeSet &Out, const Stmt *ReferenceStmt, const LocationContext *LC, const Stmt *DiagnosticStmt=nullptr, ProgramPoint::Kind K=ProgramPoint::PreStmtPurgeDeadSymbolsKind)
Run the analyzer&#39;s garbage collection - remove dead symbols and bindings from the state...
Definition: ExprEngine.cpp:402
void VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
BoundNodesTreeBuilder Nodes
void ProcessTemporaryDtor(const CFGTemporaryDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Definition: ExprEngine.cpp:760
void ProcessLoopExit(const Stmt *S, ExplodedNode *Pred)
Definition: ExprEngine.cpp:515
void GenerateAutoTransition(ExplodedNode *N)
bool hasWorkRemaining() const
Definition: CoreEngine.h:142
Follow the default settings for inlining callees.
Definition: ExprEngine.h:53
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:128
LineState State
CFGAutomaticObjDtor - Represents C++ object destructor implicitly generated for automatic object or t...
Definition: CFG.h:242
void VisitCXXDestructor(QualType ObjectType, const MemRegion *Dest, const Stmt *S, bool IsBaseDtor, ExplodedNode *Pred, ExplodedNodeSet &Dst)
bool hasEmptyWorkList() const
Definition: ExprEngine.h:324
void ProcessImplicitDtor(const CFGImplicitDtor D, ExplodedNode *Pred)
Definition: ExprEngine.cpp:622
bool wasBlocksExhausted() const
Definition: ExprEngine.h:323
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * state
ProgramStateRef processPointerEscapedOnBind(ProgramStateRef State, SVal Loc, SVal Val, const LocationContext *LCtx) override
Call PointerEscape callback when a value escapes as a result of bind.
Describes an C or C++ initializer list.
Definition: Expr.h:3974
void VisitOffsetOfExpr(const OffsetOfExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitOffsetOfExpr - Transfer function for offsetof.
BinaryOperatorKind
WorkList * getWorkList() const
Definition: CoreEngine.h:152
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3061
const Stmt * getStmt() const
void VisitReturnStmt(const ReturnStmt *R, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitReturnStmt - Transfer function logic for return statements.
const CoreEngine & getCoreEngine() const
Definition: ExprEngine.h:327
void ProcessStmt(const CFGStmt S, ExplodedNode *Pred)
Definition: ExprEngine.cpp:484
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:2779
void ProcessNewAllocator(const CXXNewExpr *NE, ExplodedNode *Pred)
Definition: ExprEngine.cpp:649
void ProcessAutomaticObjDtor(const CFGAutomaticObjDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Definition: ExprEngine.cpp:668
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1134
SVal evalComplement(SVal X)
Definition: ExprEngine.h:481
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1519
void VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitDeclStmt - Transfer function logic for DeclStmts.
ASTContext & getASTContext() override
void processStaticInitializer(const DeclStmt *DS, NodeBuilderContext &BuilderCtx, ExplodedNode *Pred, ExplodedNodeSet &Dst, const CFGBlock *DstT, const CFGBlock *DstF) override
Called by CoreEngine.
Represents the this expression in C++.
Definition: ExprCXX.h:888
void evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE, ExplodedNode *Pred, SVal location, SVal Val, bool atDeclInit=false, const ProgramPoint *PP=nullptr)
evalBind - Handle the semantics of binding a value to a specific location.
CheckerManager & getCheckerManager() const
Definition: ExprEngine.h:127
void VisitLogicalExpr(const BinaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitLogicalExpr - Transfer function logic for &#39;&&&#39;, &#39;||&#39;.
void removeDeadOnEndOfFunction(NodeBuilderContext &BC, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Remove dead bindings/symbols before exiting a function.
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.
void GenerateCallExitNode(ExplodedNode *N)
void VisitCXXCatchStmt(const CXXCatchStmt *CS, ExplodedNode *Pred, ExplodedNodeSet &Dst)
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
Definition: Expr.h:2084
SVal evalBinOp(ProgramStateRef ST, BinaryOperator::Opcode Op, SVal LHS, SVal RHS, QualType T)
Definition: ExprEngine.h:514
CFGBlock - Represents a single basic block in a source-level CFG.
Definition: CFG.h:401
void VisitInitListExpr(const InitListExpr *E, ExplodedNode *Pred, ExplodedNodeSet &Dst)
InliningModes
The modes of inlining, which override the default analysis-wide settings.
Definition: ExprEngine.h:51
void ProcessBaseDtor(const CFGBaseDtor D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Definition: ExprEngine.cpp:724
void processSwitch(SwitchNodeBuilder &builder) override
ProcessSwitch - Called by CoreEngine.
void processBeginOfFunction(NodeBuilderContext &BC, ExplodedNode *Pred, ExplodedNodeSet &Dst, const BlockEdge &L) override
Called by CoreEngine.
Expr - This represents one expression.
Definition: Expr.h:119
virtual SVal evalMinus(NonLoc val)=0
void VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr *DR, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Transfer function logic for computing the lvalue of an Objective-C ivar.
void VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
const FunctionProtoType * T
void VisitCXXNewAllocatorCall(const CXXNewExpr *CNE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitCast(const CastExpr *CastE, const Expr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitCast - Transfer function logic for all casts (implicit and explicit).
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:4984
This is the simplest builder which generates nodes in the ExplodedGraph.
Definition: CoreEngine.h:211
bool isValid() const
Definition: SVals.h:137
Represents Objective-C&#39;s @synchronized statement.
Definition: StmtObjC.h:262
void Visit(const Stmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Visit - Transfer function logic for all statements.
Definition: ExprEngine.cpp:845
std::pair< const ProgramPointTag *, const ProgramPointTag * > geteagerlyAssumeBinOpBifurcationTags()
ASTContext & getContext() const
getContext - Return the ASTContext associated with this analysis.
Definition: ExprEngine.h:123
Traits for storing the call processing policy inside GDM.
Definition: ExprEngine.h:664
ReturnStmt - This represents a return, optionally of an expression: return; return 4;...
Definition: Stmt.h:1413
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, SVal lhs, SVal rhs, QualType type)
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:860
void VisitAtomicExpr(const AtomicExpr *E, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitMemberExpr - Transfer function for builtin atomic expressions.
This represents a Microsoft inline-assembly statement extension.
Definition: Stmt.h:1795
UnaryOperator - This represents the unary-expression&#39;s (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
Definition: Expr.h:1760
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.
CFGBaseDtor - Represents C++ object destructor implicitly generated for base object in destructor...
Definition: CFG.h:290
SymbolManager & getSymbolManager()
Definition: ExprEngine.h:319
void processEndOfFunction(NodeBuilderContext &BC, ExplodedNode *Pred, const ReturnStmt *RS=nullptr) override
Called by CoreEngine.
void VisitLvalArraySubscriptExpr(const ArraySubscriptExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitArraySubscriptExpr - Transfer function for array accesses.
BugReporter is a utility class for generating PathDiagnostics for analysis.
Definition: BugReporter.h:403
void processCFGElement(const CFGElement E, ExplodedNode *Pred, unsigned StmtIdx, NodeBuilderContext *Ctx) override
processCFGElement - Called by CoreEngine.
Definition: ExprEngine.cpp:343
void VisitGuardedExpr(const Expr *Ex, const Expr *L, const Expr *R, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitGuardedExpr - Transfer function logic for ?, __builtin_choose.
ProgramPoints can be "tagged" as representing points specific to a given analysis entity...
Definition: ProgramPoint.h:40
AnalysisManager & getAnalysisManager() override
Definition: ExprEngine.h:125
void evalEagerlyAssumeBinOpBifurcation(ExplodedNodeSet &Dst, ExplodedNodeSet &Src, const Expr *Ex)
evalEagerlyAssumeBinOpBifurcation - Given the nodes in &#39;Src&#39;, eagerly assume symbolic expressions of ...
bool wasBlocksExhausted() const
Definition: CoreEngine.h:141
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
Definition: ExprCXX.h:1780
virtual bool hasWork() const =0
DeclStmt - Adaptor class for mixing declarations with statements and expressions. ...
Definition: Stmt.h:487
void VisitCompoundLiteralExpr(const CompoundLiteralExpr *CL, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitCompoundLiteralExpr - Transfer function logic for compound literals.
void processIndirectGoto(IndirectGotoNodeBuilder &builder) override
processIndirectGoto - Called by CoreEngine.
void evalCall(ExplodedNodeSet &Dst, ExplodedNode *Pred, const CallEvent &Call)
Evaluate a call, running pre- and post-call checks and allowing checkers to be responsible for handli...
ProgramStateRef handleLVectorSplat(ProgramStateRef state, const LocationContext *LCtx, const CastExpr *CastE, StmtNodeBuilder &Bldr, ExplodedNode *Pred)
void VisitCXXDeleteExpr(const CXXDeleteExpr *CDE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void processBranch(const Stmt *Condition, const Stmt *Term, NodeBuilderContext &BuilderCtx, ExplodedNode *Pred, ExplodedNodeSet &Dst, const CFGBlock *DstT, const CFGBlock *DstF) override
ProcessBranch - Called by CoreEngine.
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
Definition: SVals.h:63
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>, and corresponding __opencl_atomic_* for OpenCL 2.0.
Definition: Expr.h:5249
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Ex, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitUnaryExprOrTypeTraitExpr - Transfer function for sizeof.
void VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitObjCForCollectionStmt - Transfer function logic for ObjCForCollectionStmt.
BugReporter & getBugReporter()
Definition: ExprEngine.h:133
Do minimal inlining of callees.
Definition: ExprEngine.h:55
BasicValueFactory & getBasicVals()
Definition: ExprEngine.h:314
virtual SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op, NonLoc lhs, NonLoc rhs, QualType resultTy)=0
Create a new value which represents a binary expression with two non- location operands.
bool ExecuteWorkList(const LocationContext *L, unsigned Steps=150000)
Returns true if there is still simulation state on the worklist.
Definition: ExprEngine.h:108
ast_type_traits::DynTypedNode Node
CoreEngine - Implements the core logic of the graph-reachability analysis.
Definition: CoreEngine.h:43
void enqueueEndOfPath(ExplodedNodeSet &S)
const SymbolManager & getSymbolManager() const
Definition: ExprEngine.h:320
Dataflow Directional Tag Classes.
void VisitIncrementDecrementOperator(const UnaryOperator *U, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Handle ++ and – (both pre- and post-increment).
SValBuilder & getSValBuilder()
Definition: ExprEngine.h:131
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
Definition: ExprCXX.h:1992
StoreManager & getStoreManager()
Definition: ExprEngine.h:307
ProgramStateRef processRegionChanges(ProgramStateRef state, const InvalidatedSymbols *invalidated, ArrayRef< const MemRegion *> ExplicitRegions, ArrayRef< const MemRegion *> Regions, const LocationContext *LCtx, const CallEvent *Call) override
processRegionChanges - Called by ProgramStateManager whenever a change is made to the store...
Definition: ExprEngine.cpp:323
bool hasWorkRemaining() const
Definition: ExprEngine.h:325
This node builder keeps track of the generated sink nodes.
Definition: CoreEngine.h:313
const ExplodedGraph & getGraph() const
Definition: ExprEngine.h:160
void VisitLambdaExpr(const LambdaExpr *LE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitLambdaExpr - Transfer function logic for LambdaExprs.
Represents an abstract call to a function or method along a particular path.
Definition: CallEvent.h:140
ExprEngine(AnalysisManager &mgr, bool gcEnabled, SetOfConstDecls *VisitedCalleesIn, FunctionSummariesTy *FS, InliningModes HowToInlineIn)
Definition: ExprEngine.cpp:72
ProgramStateManager & getStateManager() override
Definition: ExprEngine.h:305
ConstraintManager & getConstraintManager()
Definition: ProgramState.h:530
ProgramStateRef handleLValueBitCast(ProgramStateRef state, const Expr *Ex, const LocationContext *LCtx, QualType T, QualType ExTy, const CastExpr *CastE, StmtNodeBuilder &Bldr, ExplodedNode *Pred)
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
Definition: SVals.h:92
SVal evalMinus(SVal X)
Definition: ExprEngine.h:477
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2178
Represents Objective-C&#39;s collection statement.
Definition: StmtObjC.h:24
void VisitCXXConstructExpr(const CXXConstructExpr *E, ExplodedNode *Pred, ExplodedNodeSet &Dst)
void VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Transfer function logic for ObjCAtSynchronizedStmts.
void VisitObjCMessage(const ObjCMessageExpr *ME, ExplodedNode *Pred, ExplodedNodeSet &Dst)
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:479
void defaultEvalCall(NodeBuilder &B, ExplodedNode *Pred, const CallEvent &Call)
Default implementation of call evaluation.
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
Definition: SemaDecl.cpp:13194
void VisitBlockExpr(const BlockExpr *BE, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitBlockExpr - Transfer function logic for BlockExprs.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:2451
virtual SVal evalComplement(NonLoc val)=0
CFGImplicitDtor - Represents C++ object destructor implicitly generated by compiler on various occasi...
Definition: CFG.h:219
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, NonLoc L, SVal R, QualType T)
Definition: ExprEngine.h:508
CXXCatchStmt - This represents a C++ catch block.
Definition: StmtCXX.h:29
CFGElement - Represents a top-level expression in a basic block.
Definition: CFG.h:54
ProgramStateRef processAssume(ProgramStateRef state, SVal cond, bool assumption) override
evalAssume - Callback function invoked by the ConstraintManager when making assumptions about state v...
Definition: ExprEngine.cpp:317
CFGMemberDtor - Represents C++ object destructor implicitly generated for member object in destructor...
Definition: CFG.h:309
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2270
void processEndWorklist(bool hasWorkRemaining) override
Called by CoreEngine when the analysis worklist has terminated.
Definition: ExprEngine.cpp:339
void VisitCommonDeclRefExpr(const Expr *DR, const NamedDecl *D, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Transfer function logic for DeclRefExprs and BlockDeclRefExprs.
CFGInitializer - Represents C++ base or member initializer from constructor&#39;s initialization list...
Definition: CFG.h:136
ExplodedGraph & getGraph()
Definition: ExprEngine.h:159
void VisitGCCAsmStmt(const GCCAsmStmt *A, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitGCCAsmStmt - Transfer function logic for inline asm.
void VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitMemberExpr - Transfer function for member expressions.
NamedDecl - This represents a decl with a name.
Definition: Decl.h:245
void ViewGraph(bool trim=false)
Visualize the ExplodedGraph created by executing the simulation.
ConstraintManager & getConstraintManager()
Definition: ExprEngine.h:309
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type, member-designator).
Definition: Expr.h:1974
void VisitBinaryOperator(const BinaryOperator *B, ExplodedNode *Pred, ExplodedNodeSet &Dst)
VisitBinaryOperator - Transfer function logic for binary operators.
Definition: ExprEngineC.cpp:41
void CreateCXXTemporaryObject(const MaterializeTemporaryExpr *ME, ExplodedNode *Pred, ExplodedNodeSet &Dst)
Create a C++ temporary object for an rvalue.
CFGTemporaryDtor - Represents C++ object destructor implicitly generated at the end of full expressio...
Definition: CFG.h:328
void processCallEnter(NodeBuilderContext &BC, CallEnter CE, ExplodedNode *Pred) override
Generate the entry node of the callee.