Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:37:08

0001 //===- ExprEngine.h - Path-Sensitive Expression-Level Dataflow --*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 //  This file defines a meta-engine for path-sensitive dataflow analysis that
0010 //  is built on CoreEngine, but provides the boilerplate to execute transfer
0011 //  functions and build the ExplodedGraph at the expression level.
0012 //
0013 //===----------------------------------------------------------------------===//
0014 
0015 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H
0016 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H
0017 
0018 #include "clang/AST/Expr.h"
0019 #include "clang/AST/Type.h"
0020 #include "clang/Analysis/CFG.h"
0021 #include "clang/Analysis/DomainSpecific/ObjCNoReturn.h"
0022 #include "clang/Analysis/ProgramPoint.h"
0023 #include "clang/Basic/LLVM.h"
0024 #include "clang/StaticAnalyzer/Core/CheckerManager.h"
0025 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h"
0026 #include "clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h"
0027 #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
0028 #include "clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h"
0029 #include "clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h"
0030 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
0031 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
0032 #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState_Fwd.h"
0033 #include "clang/StaticAnalyzer/Core/PathSensitive/Store.h"
0034 #include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h"
0035 #include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
0036 #include "clang/StaticAnalyzer/Core/PathSensitive/WorkList.h"
0037 #include "llvm/ADT/ArrayRef.h"
0038 #include <cassert>
0039 #include <optional>
0040 #include <utility>
0041 
0042 namespace clang {
0043 
0044 class AnalysisDeclContextManager;
0045 class AnalyzerOptions;
0046 class ASTContext;
0047 class CFGBlock;
0048 class CFGElement;
0049 class ConstructionContext;
0050 class CXXBindTemporaryExpr;
0051 class CXXCatchStmt;
0052 class CXXConstructExpr;
0053 class CXXDeleteExpr;
0054 class CXXNewExpr;
0055 class CXXThisExpr;
0056 class Decl;
0057 class DeclStmt;
0058 class GCCAsmStmt;
0059 class LambdaExpr;
0060 class LocationContext;
0061 class MaterializeTemporaryExpr;
0062 class MSAsmStmt;
0063 class NamedDecl;
0064 class ObjCAtSynchronizedStmt;
0065 class ObjCForCollectionStmt;
0066 class ObjCIvarRefExpr;
0067 class ObjCMessageExpr;
0068 class ReturnStmt;
0069 class Stmt;
0070 
0071 namespace cross_tu {
0072 
0073 class CrossTranslationUnitContext;
0074 
0075 } // namespace cross_tu
0076 
0077 namespace ento {
0078 
0079 class AnalysisManager;
0080 class BasicValueFactory;
0081 class CallEvent;
0082 class CheckerManager;
0083 class ConstraintManager;
0084 class ExplodedNodeSet;
0085 class ExplodedNode;
0086 class IndirectGotoNodeBuilder;
0087 class MemRegion;
0088 class NodeBuilderContext;
0089 class NodeBuilderWithSinks;
0090 class ProgramState;
0091 class ProgramStateManager;
0092 class RegionAndSymbolInvalidationTraits;
0093 class SymbolManager;
0094 class SwitchNodeBuilder;
0095 
0096 /// Hints for figuring out of a call should be inlined during evalCall().
0097 struct EvalCallOptions {
0098   /// This call is a constructor or a destructor for which we do not currently
0099   /// compute the this-region correctly.
0100   bool IsCtorOrDtorWithImproperlyModeledTargetRegion = false;
0101 
0102   /// This call is a constructor or a destructor for a single element within
0103   /// an array, a part of array construction or destruction.
0104   bool IsArrayCtorOrDtor = false;
0105 
0106   /// This call is a constructor or a destructor of a temporary value.
0107   bool IsTemporaryCtorOrDtor = false;
0108 
0109   /// This call is a constructor for a temporary that is lifetime-extended
0110   /// by binding it to a reference-type field within an aggregate,
0111   /// for example 'A { const C &c; }; A a = { C() };'
0112   bool IsTemporaryLifetimeExtendedViaAggregate = false;
0113 
0114   /// This call is a pre-C++17 elidable constructor that we failed to elide
0115   /// because we failed to compute the target region into which
0116   /// this constructor would have been ultimately elided. Analysis that
0117   /// we perform in this case is still correct but it behaves differently,
0118   /// as if copy elision is disabled.
0119   bool IsElidableCtorThatHasNotBeenElided = false;
0120 
0121   EvalCallOptions() {}
0122 };
0123 
0124 class ExprEngine {
0125   void anchor();
0126 
0127 public:
0128   /// The modes of inlining, which override the default analysis-wide settings.
0129   enum InliningModes {
0130     /// Follow the default settings for inlining callees.
0131     Inline_Regular = 0,
0132 
0133     /// Do minimal inlining of callees.
0134     Inline_Minimal = 0x1
0135   };
0136 
0137 private:
0138   cross_tu::CrossTranslationUnitContext &CTU;
0139   bool IsCTUEnabled;
0140 
0141   AnalysisManager &AMgr;
0142 
0143   AnalysisDeclContextManager &AnalysisDeclContexts;
0144 
0145   CoreEngine Engine;
0146 
0147   /// G - the simulation graph.
0148   ExplodedGraph &G;
0149 
0150   /// StateMgr - Object that manages the data for all created states.
0151   ProgramStateManager StateMgr;
0152 
0153   /// SymMgr - Object that manages the symbol information.
0154   SymbolManager &SymMgr;
0155 
0156   /// MRMgr - MemRegionManager object that creates memory regions.
0157   MemRegionManager &MRMgr;
0158 
0159   /// svalBuilder - SValBuilder object that creates SVals from expressions.
0160   SValBuilder &svalBuilder;
0161 
0162   unsigned int currStmtIdx = 0;
0163   const NodeBuilderContext *currBldrCtx = nullptr;
0164 
0165   /// Helper object to determine if an Objective-C message expression
0166   /// implicitly never returns.
0167   ObjCNoReturn ObjCNoRet;
0168 
0169   /// The BugReporter associated with this engine.  It is important that
0170   /// this object be placed at the very end of member variables so that its
0171   /// destructor is called before the rest of the ExprEngine is destroyed.
0172   PathSensitiveBugReporter BR;
0173 
0174   /// The functions which have been analyzed through inlining. This is owned by
0175   /// AnalysisConsumer. It can be null.
0176   SetOfConstDecls *VisitedCallees;
0177 
0178   /// The flag, which specifies the mode of inlining for the engine.
0179   InliningModes HowToInline;
0180 
0181 public:
0182   ExprEngine(cross_tu::CrossTranslationUnitContext &CTU, AnalysisManager &mgr,
0183              SetOfConstDecls *VisitedCalleesIn,
0184              FunctionSummariesTy *FS, InliningModes HowToInlineIn);
0185 
0186   virtual ~ExprEngine() = default;
0187 
0188   /// Returns true if there is still simulation state on the worklist.
0189   bool ExecuteWorkList(const LocationContext *L, unsigned Steps = 150000) {
0190     assert(L->inTopFrame());
0191     BR.setAnalysisEntryPoint(L->getDecl());
0192     return Engine.ExecuteWorkList(L, Steps, nullptr);
0193   }
0194 
0195   /// getContext - Return the ASTContext associated with this analysis.
0196   ASTContext &getContext() const { return AMgr.getASTContext(); }
0197 
0198   AnalysisManager &getAnalysisManager() { return AMgr; }
0199 
0200   AnalysisDeclContextManager &getAnalysisDeclContextManager() {
0201     return AMgr.getAnalysisDeclContextManager();
0202   }
0203 
0204   CheckerManager &getCheckerManager() const {
0205     return *AMgr.getCheckerManager();
0206   }
0207 
0208   SValBuilder &getSValBuilder() { return svalBuilder; }
0209 
0210   BugReporter &getBugReporter() { return BR; }
0211 
0212   cross_tu::CrossTranslationUnitContext *
0213   getCrossTranslationUnitContext() {
0214     return &CTU;
0215   }
0216 
0217   const NodeBuilderContext &getBuilderContext() {
0218     assert(currBldrCtx);
0219     return *currBldrCtx;
0220   }
0221 
0222   const Stmt *getStmt() const;
0223 
0224   const LocationContext *getRootLocationContext() const {
0225     assert(G.roots_begin() != G.roots_end());
0226     return (*G.roots_begin())->getLocation().getLocationContext();
0227   }
0228 
0229   CFGBlock::ConstCFGElementRef getCFGElementRef() const {
0230     const CFGBlock *blockPtr = currBldrCtx ? currBldrCtx->getBlock() : nullptr;
0231     return {blockPtr, currStmtIdx};
0232   }
0233 
0234   /// Dump graph to the specified filename.
0235   /// If filename is empty, generate a temporary one.
0236   /// \return The filename the graph is written into.
0237   std::string DumpGraph(bool trim = false, StringRef Filename="");
0238 
0239   /// Dump the graph consisting of the given nodes to a specified filename.
0240   /// Generate a temporary filename if it's not provided.
0241   /// \return The filename the graph is written into.
0242   std::string DumpGraph(ArrayRef<const ExplodedNode *> Nodes,
0243                         StringRef Filename = "");
0244 
0245   /// Visualize the ExplodedGraph created by executing the simulation.
0246   void ViewGraph(bool trim = false);
0247 
0248   /// Visualize a trimmed ExplodedGraph that only contains paths to the given
0249   /// nodes.
0250   void ViewGraph(ArrayRef<const ExplodedNode *> Nodes);
0251 
0252   /// getInitialState - Return the initial state used for the root vertex
0253   ///  in the ExplodedGraph.
0254   ProgramStateRef getInitialState(const LocationContext *InitLoc);
0255 
0256   ExplodedGraph &getGraph() { return G; }
0257   const ExplodedGraph &getGraph() const { return G; }
0258 
0259   /// Run the analyzer's garbage collection - remove dead symbols and
0260   /// bindings from the state.
0261   ///
0262   /// Checkers can participate in this process with two callbacks:
0263   /// \c checkLiveSymbols and \c checkDeadSymbols. See the CheckerDocumentation
0264   /// class for more information.
0265   ///
0266   /// \param Node The predecessor node, from which the processing should start.
0267   /// \param Out The returned set of output nodes.
0268   /// \param ReferenceStmt The statement which is about to be processed.
0269   ///        Everything needed for this statement should be considered live.
0270   ///        A null statement means that everything in child LocationContexts
0271   ///        is dead.
0272   /// \param LC The location context of the \p ReferenceStmt. A null location
0273   ///        context means that we have reached the end of analysis and that
0274   ///        all statements and local variables should be considered dead.
0275   /// \param DiagnosticStmt Used as a location for any warnings that should
0276   ///        occur while removing the dead (e.g. leaks). By default, the
0277   ///        \p ReferenceStmt is used.
0278   /// \param K Denotes whether this is a pre- or post-statement purge. This
0279   ///        must only be ProgramPoint::PostStmtPurgeDeadSymbolsKind if an
0280   ///        entire location context is being cleared, in which case the
0281   ///        \p ReferenceStmt must either be a ReturnStmt or \c NULL. Otherwise,
0282   ///        it must be ProgramPoint::PreStmtPurgeDeadSymbolsKind (the default)
0283   ///        and \p ReferenceStmt must be valid (non-null).
0284   void removeDead(ExplodedNode *Node, ExplodedNodeSet &Out,
0285             const Stmt *ReferenceStmt, const LocationContext *LC,
0286             const Stmt *DiagnosticStmt = nullptr,
0287             ProgramPoint::Kind K = ProgramPoint::PreStmtPurgeDeadSymbolsKind);
0288 
0289   /// A tag to track convenience transitions, which can be removed at cleanup.
0290   /// This tag applies to a node created after removeDead.
0291   static const ProgramPointTag *cleanupNodeTag();
0292 
0293   /// processCFGElement - Called by CoreEngine. Used to generate new successor
0294   ///  nodes by processing the 'effects' of a CFG element.
0295   void processCFGElement(const CFGElement E, ExplodedNode *Pred,
0296                          unsigned StmtIdx, NodeBuilderContext *Ctx);
0297 
0298   void ProcessStmt(const Stmt *S, ExplodedNode *Pred);
0299 
0300   void ProcessLoopExit(const Stmt* S, ExplodedNode *Pred);
0301 
0302   void ProcessInitializer(const CFGInitializer I, ExplodedNode *Pred);
0303 
0304   void ProcessImplicitDtor(const CFGImplicitDtor D, ExplodedNode *Pred);
0305 
0306   void ProcessNewAllocator(const CXXNewExpr *NE, ExplodedNode *Pred);
0307 
0308   void ProcessAutomaticObjDtor(const CFGAutomaticObjDtor D,
0309                                ExplodedNode *Pred, ExplodedNodeSet &Dst);
0310   void ProcessDeleteDtor(const CFGDeleteDtor D,
0311                          ExplodedNode *Pred, ExplodedNodeSet &Dst);
0312   void ProcessBaseDtor(const CFGBaseDtor D,
0313                        ExplodedNode *Pred, ExplodedNodeSet &Dst);
0314   void ProcessMemberDtor(const CFGMemberDtor D,
0315                          ExplodedNode *Pred, ExplodedNodeSet &Dst);
0316   void ProcessTemporaryDtor(const CFGTemporaryDtor D,
0317                             ExplodedNode *Pred, ExplodedNodeSet &Dst);
0318 
0319   /// Called by CoreEngine when processing the entrance of a CFGBlock.
0320   void processCFGBlockEntrance(const BlockEdge &L,
0321                                NodeBuilderWithSinks &nodeBuilder,
0322                                ExplodedNode *Pred);
0323 
0324   /// ProcessBranch - Called by CoreEngine. Used to generate successor nodes by
0325   /// processing the 'effects' of a branch condition. If the branch condition
0326   /// is a loop condition, IterationsCompletedInLoop is the number of completed
0327   /// iterations (otherwise it's std::nullopt).
0328   void processBranch(const Stmt *Condition, NodeBuilderContext &BuilderCtx,
0329                      ExplodedNode *Pred, ExplodedNodeSet &Dst,
0330                      const CFGBlock *DstT, const CFGBlock *DstF,
0331                      std::optional<unsigned> IterationsCompletedInLoop);
0332 
0333   /// Called by CoreEngine.
0334   /// Used to generate successor nodes for temporary destructors depending
0335   /// on whether the corresponding constructor was visited.
0336   void processCleanupTemporaryBranch(const CXXBindTemporaryExpr *BTE,
0337                                      NodeBuilderContext &BldCtx,
0338                                      ExplodedNode *Pred, ExplodedNodeSet &Dst,
0339                                      const CFGBlock *DstT,
0340                                      const CFGBlock *DstF);
0341 
0342   /// Called by CoreEngine.  Used to processing branching behavior
0343   /// at static initializers.
0344   void processStaticInitializer(const DeclStmt *DS,
0345                                 NodeBuilderContext& BuilderCtx,
0346                                 ExplodedNode *Pred,
0347                                 ExplodedNodeSet &Dst,
0348                                 const CFGBlock *DstT,
0349                                 const CFGBlock *DstF);
0350 
0351   /// processIndirectGoto - Called by CoreEngine.  Used to generate successor
0352   ///  nodes by processing the 'effects' of a computed goto jump.
0353   void processIndirectGoto(IndirectGotoNodeBuilder& builder);
0354 
0355   /// ProcessSwitch - Called by CoreEngine.  Used to generate successor
0356   ///  nodes by processing the 'effects' of a switch statement.
0357   void processSwitch(SwitchNodeBuilder& builder);
0358 
0359   /// Called by CoreEngine.  Used to notify checkers that processing a
0360   /// function has begun. Called for both inlined and top-level functions.
0361   void processBeginOfFunction(NodeBuilderContext &BC,
0362                               ExplodedNode *Pred, ExplodedNodeSet &Dst,
0363                               const BlockEdge &L);
0364 
0365   /// Called by CoreEngine.  Used to notify checkers that processing a
0366   /// function has ended. Called for both inlined and top-level functions.
0367   void processEndOfFunction(NodeBuilderContext& BC,
0368                             ExplodedNode *Pred,
0369                             const ReturnStmt *RS = nullptr);
0370 
0371   /// Remove dead bindings/symbols before exiting a function.
0372   void removeDeadOnEndOfFunction(NodeBuilderContext& BC,
0373                                  ExplodedNode *Pred,
0374                                  ExplodedNodeSet &Dst);
0375 
0376   /// Generate the entry node of the callee.
0377   void processCallEnter(NodeBuilderContext& BC, CallEnter CE,
0378                         ExplodedNode *Pred);
0379 
0380   /// Generate the sequence of nodes that simulate the call exit and the post
0381   /// visit for CallExpr.
0382   void processCallExit(ExplodedNode *Pred);
0383 
0384   /// Called by CoreEngine when the analysis worklist has terminated.
0385   void processEndWorklist();
0386 
0387   /// evalAssume - Callback function invoked by the ConstraintManager when
0388   ///  making assumptions about state values.
0389   ProgramStateRef processAssume(ProgramStateRef state, SVal cond,
0390                                 bool assumption);
0391 
0392   /// processRegionChanges - Called by ProgramStateManager whenever a change is made
0393   ///  to the store. Used to update checkers that track region values.
0394   ProgramStateRef
0395   processRegionChanges(ProgramStateRef state,
0396                        const InvalidatedSymbols *invalidated,
0397                        ArrayRef<const MemRegion *> ExplicitRegions,
0398                        ArrayRef<const MemRegion *> Regions,
0399                        const LocationContext *LCtx,
0400                        const CallEvent *Call);
0401 
0402   inline ProgramStateRef
0403   processRegionChange(ProgramStateRef state,
0404                       const MemRegion* MR,
0405                       const LocationContext *LCtx) {
0406     return processRegionChanges(state, nullptr, MR, MR, LCtx, nullptr);
0407   }
0408 
0409   /// printJson - Called by ProgramStateManager to print checker-specific data.
0410   void printJson(raw_ostream &Out, ProgramStateRef State,
0411                  const LocationContext *LCtx, const char *NL,
0412                  unsigned int Space, bool IsDot) const;
0413 
0414   ProgramStateManager &getStateManager() { return StateMgr; }
0415 
0416   StoreManager &getStoreManager() { return StateMgr.getStoreManager(); }
0417 
0418   ConstraintManager &getConstraintManager() {
0419     return StateMgr.getConstraintManager();
0420   }
0421 
0422   // FIXME: Remove when we migrate over to just using SValBuilder.
0423   BasicValueFactory &getBasicVals() {
0424     return StateMgr.getBasicVals();
0425   }
0426 
0427   SymbolManager &getSymbolManager() { return SymMgr; }
0428   MemRegionManager &getRegionManager() { return MRMgr; }
0429 
0430   DataTag::Factory &getDataTags() { return Engine.getDataTags(); }
0431 
0432   // Functions for external checking of whether we have unfinished work
0433   bool wasBlocksExhausted() const { return Engine.wasBlocksExhausted(); }
0434   bool hasEmptyWorkList() const { return !Engine.getWorkList()->hasWork(); }
0435   bool hasWorkRemaining() const { return Engine.hasWorkRemaining(); }
0436 
0437   const CoreEngine &getCoreEngine() const { return Engine; }
0438 
0439 public:
0440   /// Visit - Transfer function logic for all statements.  Dispatches to
0441   ///  other functions that handle specific kinds of statements.
0442   void Visit(const Stmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst);
0443 
0444   /// VisitArrayInitLoopExpr - Transfer function for array init loop.
0445   void VisitArrayInitLoopExpr(const ArrayInitLoopExpr *Ex, ExplodedNode *Pred,
0446                               ExplodedNodeSet &Dst);
0447 
0448   /// VisitArraySubscriptExpr - Transfer function for array accesses.
0449   void VisitArraySubscriptExpr(const ArraySubscriptExpr *Ex,
0450                                ExplodedNode *Pred,
0451                                ExplodedNodeSet &Dst);
0452 
0453   /// VisitGCCAsmStmt - Transfer function logic for inline asm.
0454   void VisitGCCAsmStmt(const GCCAsmStmt *A, ExplodedNode *Pred,
0455                        ExplodedNodeSet &Dst);
0456 
0457   /// VisitMSAsmStmt - Transfer function logic for MS inline asm.
0458   void VisitMSAsmStmt(const MSAsmStmt *A, ExplodedNode *Pred,
0459                       ExplodedNodeSet &Dst);
0460 
0461   /// VisitBlockExpr - Transfer function logic for BlockExprs.
0462   void VisitBlockExpr(const BlockExpr *BE, ExplodedNode *Pred,
0463                       ExplodedNodeSet &Dst);
0464 
0465   /// VisitLambdaExpr - Transfer function logic for LambdaExprs.
0466   void VisitLambdaExpr(const LambdaExpr *LE, ExplodedNode *Pred,
0467                        ExplodedNodeSet &Dst);
0468 
0469   /// VisitBinaryOperator - Transfer function logic for binary operators.
0470   void VisitBinaryOperator(const BinaryOperator* B, ExplodedNode *Pred,
0471                            ExplodedNodeSet &Dst);
0472 
0473 
0474   /// VisitCall - Transfer function for function calls.
0475   void VisitCallExpr(const CallExpr *CE, ExplodedNode *Pred,
0476                      ExplodedNodeSet &Dst);
0477 
0478   /// VisitCast - Transfer function logic for all casts (implicit and explicit).
0479   void VisitCast(const CastExpr *CastE, const Expr *Ex, ExplodedNode *Pred,
0480                  ExplodedNodeSet &Dst);
0481 
0482   /// VisitCompoundLiteralExpr - Transfer function logic for compound literals.
0483   void VisitCompoundLiteralExpr(const CompoundLiteralExpr *CL,
0484                                 ExplodedNode *Pred, ExplodedNodeSet &Dst);
0485 
0486   /// Transfer function logic for DeclRefExprs and BlockDeclRefExprs.
0487   void VisitCommonDeclRefExpr(const Expr *DR, const NamedDecl *D,
0488                               ExplodedNode *Pred, ExplodedNodeSet &Dst);
0489 
0490   /// VisitDeclStmt - Transfer function logic for DeclStmts.
0491   void VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred,
0492                      ExplodedNodeSet &Dst);
0493 
0494   /// VisitGuardedExpr - Transfer function logic for ?, __builtin_choose
0495   void VisitGuardedExpr(const Expr *Ex, const Expr *L, const Expr *R,
0496                         ExplodedNode *Pred, ExplodedNodeSet &Dst);
0497 
0498   void VisitInitListExpr(const InitListExpr *E, ExplodedNode *Pred,
0499                          ExplodedNodeSet &Dst);
0500 
0501   /// VisitLogicalExpr - Transfer function logic for '&&', '||'
0502   void VisitLogicalExpr(const BinaryOperator* B, ExplodedNode *Pred,
0503                         ExplodedNodeSet &Dst);
0504 
0505   /// VisitMemberExpr - Transfer function for member expressions.
0506   void VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred,
0507                        ExplodedNodeSet &Dst);
0508 
0509   /// VisitAtomicExpr - Transfer function for builtin atomic expressions
0510   void VisitAtomicExpr(const AtomicExpr *E, ExplodedNode *Pred,
0511                        ExplodedNodeSet &Dst);
0512 
0513   /// Transfer function logic for ObjCAtSynchronizedStmts.
0514   void VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S,
0515                                    ExplodedNode *Pred, ExplodedNodeSet &Dst);
0516 
0517   /// Transfer function logic for computing the lvalue of an Objective-C ivar.
0518   void VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr *DR, ExplodedNode *Pred,
0519                                 ExplodedNodeSet &Dst);
0520 
0521   /// VisitObjCForCollectionStmt - Transfer function logic for
0522   ///  ObjCForCollectionStmt.
0523   void VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S,
0524                                   ExplodedNode *Pred, ExplodedNodeSet &Dst);
0525 
0526   void VisitObjCMessage(const ObjCMessageExpr *ME, ExplodedNode *Pred,
0527                         ExplodedNodeSet &Dst);
0528 
0529   /// VisitReturnStmt - Transfer function logic for return statements.
0530   void VisitReturnStmt(const ReturnStmt *R, ExplodedNode *Pred,
0531                        ExplodedNodeSet &Dst);
0532 
0533   /// VisitOffsetOfExpr - Transfer function for offsetof.
0534   void VisitOffsetOfExpr(const OffsetOfExpr *Ex, ExplodedNode *Pred,
0535                          ExplodedNodeSet &Dst);
0536 
0537   /// VisitUnaryExprOrTypeTraitExpr - Transfer function for sizeof.
0538   void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Ex,
0539                                      ExplodedNode *Pred, ExplodedNodeSet &Dst);
0540 
0541   /// VisitUnaryOperator - Transfer function logic for unary operators.
0542   void VisitUnaryOperator(const UnaryOperator* B, ExplodedNode *Pred,
0543                           ExplodedNodeSet &Dst);
0544 
0545   /// Handle ++ and -- (both pre- and post-increment).
0546   void VisitIncrementDecrementOperator(const UnaryOperator* U,
0547                                        ExplodedNode *Pred,
0548                                        ExplodedNodeSet &Dst);
0549 
0550   void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE,
0551                                  ExplodedNodeSet &PreVisit,
0552                                  ExplodedNodeSet &Dst);
0553 
0554   void VisitCXXCatchStmt(const CXXCatchStmt *CS, ExplodedNode *Pred,
0555                          ExplodedNodeSet &Dst);
0556 
0557   void VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred,
0558                         ExplodedNodeSet & Dst);
0559 
0560   void VisitCXXConstructExpr(const CXXConstructExpr *E, ExplodedNode *Pred,
0561                              ExplodedNodeSet &Dst);
0562 
0563   void VisitCXXInheritedCtorInitExpr(const CXXInheritedCtorInitExpr *E,
0564                                      ExplodedNode *Pred, ExplodedNodeSet &Dst);
0565 
0566   void VisitCXXDestructor(QualType ObjectType, const MemRegion *Dest,
0567                           const Stmt *S, bool IsBaseDtor,
0568                           ExplodedNode *Pred, ExplodedNodeSet &Dst,
0569                           EvalCallOptions &Options);
0570 
0571   void VisitCXXNewAllocatorCall(const CXXNewExpr *CNE,
0572                                 ExplodedNode *Pred,
0573                                 ExplodedNodeSet &Dst);
0574 
0575   void VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred,
0576                        ExplodedNodeSet &Dst);
0577 
0578   void VisitCXXDeleteExpr(const CXXDeleteExpr *CDE, ExplodedNode *Pred,
0579                           ExplodedNodeSet &Dst);
0580 
0581   /// Create a C++ temporary object for an rvalue.
0582   void CreateCXXTemporaryObject(const MaterializeTemporaryExpr *ME,
0583                                 ExplodedNode *Pred,
0584                                 ExplodedNodeSet &Dst);
0585 
0586   /// evalEagerlyAssumeBifurcation - Given the nodes in 'Src', eagerly assume
0587   /// concrete boolean values for 'Ex', storing the resulting nodes in 'Dst'.
0588   void evalEagerlyAssumeBifurcation(ExplodedNodeSet &Dst, ExplodedNodeSet &Src,
0589                                     const Expr *Ex);
0590 
0591   bool didEagerlyAssumeBifurcateAt(ProgramStateRef State, const Expr *Ex) const;
0592 
0593   static std::pair<const ProgramPointTag *, const ProgramPointTag *>
0594   getEagerlyAssumeBifurcationTags();
0595 
0596   ProgramStateRef handleLValueBitCast(ProgramStateRef state, const Expr *Ex,
0597                                       const LocationContext *LCtx, QualType T,
0598                                       QualType ExTy, const CastExpr *CastE,
0599                                       StmtNodeBuilder &Bldr,
0600                                       ExplodedNode *Pred);
0601 
0602   void handleUOExtension(ExplodedNode *N, const UnaryOperator *U,
0603                          StmtNodeBuilder &Bldr);
0604 
0605 public:
0606   SVal evalBinOp(ProgramStateRef ST, BinaryOperator::Opcode Op,
0607                  SVal LHS, SVal RHS, QualType T) {
0608     return svalBuilder.evalBinOp(ST, Op, LHS, RHS, T);
0609   }
0610 
0611   /// Retreives which element is being constructed in a non-POD type array.
0612   static std::optional<unsigned>
0613   getIndexOfElementToConstruct(ProgramStateRef State, const CXXConstructExpr *E,
0614                                const LocationContext *LCtx);
0615 
0616   /// Retreives which element is being destructed in a non-POD type array.
0617   static std::optional<unsigned>
0618   getPendingArrayDestruction(ProgramStateRef State,
0619                              const LocationContext *LCtx);
0620 
0621   /// Retreives the size of the array in the pending ArrayInitLoopExpr.
0622   static std::optional<unsigned>
0623   getPendingInitLoop(ProgramStateRef State, const CXXConstructExpr *E,
0624                      const LocationContext *LCtx);
0625 
0626   /// By looking at a certain item that may be potentially part of an object's
0627   /// ConstructionContext, retrieve such object's location. A particular
0628   /// statement can be transparently passed as \p Item in most cases.
0629   static std::optional<SVal>
0630   getObjectUnderConstruction(ProgramStateRef State,
0631                              const ConstructionContextItem &Item,
0632                              const LocationContext *LC);
0633 
0634   /// Call PointerEscape callback when a value escapes as a result of bind.
0635   ProgramStateRef processPointerEscapedOnBind(
0636       ProgramStateRef State, ArrayRef<std::pair<SVal, SVal>> LocAndVals,
0637       const LocationContext *LCtx, PointerEscapeKind Kind,
0638       const CallEvent *Call);
0639 
0640   /// Call PointerEscape callback when a value escapes as a result of
0641   /// region invalidation.
0642   /// \param[in] ITraits Specifies invalidation traits for regions/symbols.
0643   ProgramStateRef notifyCheckersOfPointerEscape(
0644                            ProgramStateRef State,
0645                            const InvalidatedSymbols *Invalidated,
0646                            ArrayRef<const MemRegion *> ExplicitRegions,
0647                            const CallEvent *Call,
0648                            RegionAndSymbolInvalidationTraits &ITraits);
0649 
0650 private:
0651   /// evalBind - Handle the semantics of binding a value to a specific location.
0652   ///  This method is used by evalStore, VisitDeclStmt, and others.
0653   void evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE, ExplodedNode *Pred,
0654                 SVal location, SVal Val, bool atDeclInit = false,
0655                 const ProgramPoint *PP = nullptr);
0656 
0657   ProgramStateRef
0658   processPointerEscapedOnBind(ProgramStateRef State,
0659                               SVal Loc, SVal Val,
0660                               const LocationContext *LCtx);
0661 
0662   /// A simple wrapper when you only need to notify checkers of pointer-escape
0663   /// of some values.
0664   ProgramStateRef escapeValues(ProgramStateRef State, ArrayRef<SVal> Vs,
0665                                PointerEscapeKind K,
0666                                const CallEvent *Call = nullptr) const;
0667 
0668 public:
0669   // FIXME: 'tag' should be removed, and a LocationContext should be used
0670   // instead.
0671   // FIXME: Comment on the meaning of the arguments, when 'St' may not
0672   // be the same as Pred->state, and when 'location' may not be the
0673   // same as state->getLValue(Ex).
0674   /// Simulate a read of the result of Ex.
0675   void evalLoad(ExplodedNodeSet &Dst,
0676                 const Expr *NodeEx,  /* Eventually will be a CFGStmt */
0677                 const Expr *BoundExpr,
0678                 ExplodedNode *Pred,
0679                 ProgramStateRef St,
0680                 SVal location,
0681                 const ProgramPointTag *tag = nullptr,
0682                 QualType LoadTy = QualType());
0683 
0684   // FIXME: 'tag' should be removed, and a LocationContext should be used
0685   // instead.
0686   void evalStore(ExplodedNodeSet &Dst, const Expr *AssignE, const Expr *StoreE,
0687                  ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val,
0688                  const ProgramPointTag *tag = nullptr);
0689 
0690   /// Return the CFG element corresponding to the worklist element
0691   /// that is currently being processed by ExprEngine.
0692   CFGElement getCurrentCFGElement() {
0693     return (*currBldrCtx->getBlock())[currStmtIdx];
0694   }
0695 
0696   /// Create a new state in which the call return value is binded to the
0697   /// call origin expression.
0698   ProgramStateRef bindReturnValue(const CallEvent &Call,
0699                                   const LocationContext *LCtx,
0700                                   ProgramStateRef State);
0701 
0702   /// Evaluate a call, running pre- and post-call checkers and allowing checkers
0703   /// to be responsible for handling the evaluation of the call itself.
0704   void evalCall(ExplodedNodeSet &Dst, ExplodedNode *Pred,
0705                 const CallEvent &Call);
0706 
0707   /// Default implementation of call evaluation.
0708   void defaultEvalCall(NodeBuilder &B, ExplodedNode *Pred,
0709                        const CallEvent &Call,
0710                        const EvalCallOptions &CallOpts = {});
0711 
0712   /// Find location of the object that is being constructed by a given
0713   /// constructor. This should ideally always succeed but due to not being
0714   /// fully implemented it sometimes indicates that it failed via its
0715   /// out-parameter CallOpts; in such cases a fake temporary region is
0716   /// returned, which is better than nothing but does not represent
0717   /// the actual behavior of the program. The Idx parameter is used if we
0718   /// construct an array of objects. In that case it points to the index
0719   /// of the continuous memory region.
0720   /// E.g.:
0721   /// For `int arr[4]` this index can be 0,1,2,3.
0722   /// For `int arr2[3][3]` this index can be 0,1,...,7,8.
0723   /// A multi-dimensional array is also a continuous memory location in a
0724   /// row major order, so for arr[0][0] Idx is 0 and for arr[2][2] Idx is 8.
0725   SVal computeObjectUnderConstruction(const Expr *E, ProgramStateRef State,
0726                                       const NodeBuilderContext *BldrCtx,
0727                                       const LocationContext *LCtx,
0728                                       const ConstructionContext *CC,
0729                                       EvalCallOptions &CallOpts,
0730                                       unsigned Idx = 0);
0731 
0732   /// Update the program state with all the path-sensitive information
0733   /// that's necessary to perform construction of an object with a given
0734   /// syntactic construction context. V and CallOpts have to be obtained from
0735   /// computeObjectUnderConstruction() invoked with the same set of
0736   /// the remaining arguments (E, State, LCtx, CC).
0737   ProgramStateRef updateObjectsUnderConstruction(
0738       SVal V, const Expr *E, ProgramStateRef State, const LocationContext *LCtx,
0739       const ConstructionContext *CC, const EvalCallOptions &CallOpts);
0740 
0741   /// A convenient wrapper around computeObjectUnderConstruction
0742   /// and updateObjectsUnderConstruction.
0743   std::pair<ProgramStateRef, SVal> handleConstructionContext(
0744       const Expr *E, ProgramStateRef State, const NodeBuilderContext *BldrCtx,
0745       const LocationContext *LCtx, const ConstructionContext *CC,
0746       EvalCallOptions &CallOpts, unsigned Idx = 0) {
0747 
0748     SVal V = computeObjectUnderConstruction(E, State, BldrCtx, LCtx, CC,
0749                                             CallOpts, Idx);
0750     State = updateObjectsUnderConstruction(V, E, State, LCtx, CC, CallOpts);
0751 
0752     return std::make_pair(State, V);
0753   }
0754 
0755 private:
0756   ProgramStateRef finishArgumentConstruction(ProgramStateRef State,
0757                                              const CallEvent &Call);
0758   void finishArgumentConstruction(ExplodedNodeSet &Dst, ExplodedNode *Pred,
0759                                   const CallEvent &Call);
0760 
0761   void evalLocation(ExplodedNodeSet &Dst,
0762                     const Stmt *NodeEx, /* This will eventually be a CFGStmt */
0763                     const Stmt *BoundEx,
0764                     ExplodedNode *Pred,
0765                     ProgramStateRef St,
0766                     SVal location,
0767                     bool isLoad);
0768 
0769   /// Count the stack depth and determine if the call is recursive.
0770   void examineStackFrames(const Decl *D, const LocationContext *LCtx,
0771                           bool &IsRecursive, unsigned &StackDepth);
0772 
0773   enum CallInlinePolicy {
0774     CIP_Allowed,
0775     CIP_DisallowedOnce,
0776     CIP_DisallowedAlways
0777   };
0778 
0779   /// See if a particular call should be inlined, by only looking
0780   /// at the call event and the current state of analysis.
0781   CallInlinePolicy mayInlineCallKind(const CallEvent &Call,
0782                                      const ExplodedNode *Pred,
0783                                      AnalyzerOptions &Opts,
0784                                      const EvalCallOptions &CallOpts);
0785 
0786   /// See if the given AnalysisDeclContext is built for a function that we
0787   /// should always inline simply because it's small enough.
0788   /// Apart from "small" functions, we also have "large" functions
0789   /// (cf. isLarge()), some of which are huge (cf. isHuge()), and we classify
0790   /// the remaining functions as "medium".
0791   bool isSmall(AnalysisDeclContext *ADC) const;
0792 
0793   /// See if the given AnalysisDeclContext is built for a function that we
0794   /// should inline carefully because it looks pretty large.
0795   bool isLarge(AnalysisDeclContext *ADC) const;
0796 
0797   /// See if the given AnalysisDeclContext is built for a function that we
0798   /// should never inline because it's legit gigantic.
0799   bool isHuge(AnalysisDeclContext *ADC) const;
0800 
0801   /// See if the given AnalysisDeclContext is built for a function that we
0802   /// should inline, just by looking at the declaration of the function.
0803   bool mayInlineDecl(AnalysisDeclContext *ADC) const;
0804 
0805   /// Checks our policies and decides weither the given call should be inlined.
0806   bool shouldInlineCall(const CallEvent &Call, const Decl *D,
0807                         const ExplodedNode *Pred,
0808                         const EvalCallOptions &CallOpts = {});
0809 
0810   /// Checks whether our policies allow us to inline a non-POD type array
0811   /// construction.
0812   bool shouldInlineArrayConstruction(const ProgramStateRef State,
0813                                      const CXXConstructExpr *CE,
0814                                      const LocationContext *LCtx);
0815 
0816   /// Checks whether our policies allow us to inline a non-POD type array
0817   /// destruction.
0818   /// \param Size The size of the array.
0819   bool shouldInlineArrayDestruction(uint64_t Size);
0820 
0821   /// Prepares the program state for array destruction. If no error happens
0822   /// the function binds a 'PendingArrayDestruction' entry to the state, which
0823   /// it returns along with the index. If any error happens (we fail to read
0824   /// the size, the index would be -1, etc.) the function will return the
0825   /// original state along with an index of 0. The actual element count of the
0826   /// array can be accessed by the optional 'ElementCountVal' parameter. \param
0827   /// State The program state. \param Region The memory region where the array
0828   /// is stored. \param ElementTy The type an element in the array. \param LCty
0829   /// The location context. \param ElementCountVal A pointer to an optional
0830   /// SVal. If specified, the size of the array will be returned in it. It can
0831   /// be Unknown.
0832   std::pair<ProgramStateRef, uint64_t> prepareStateForArrayDestruction(
0833       const ProgramStateRef State, const MemRegion *Region,
0834       const QualType &ElementTy, const LocationContext *LCtx,
0835       SVal *ElementCountVal = nullptr);
0836 
0837   /// Checks whether we construct an array of non-POD type, and decides if the
0838   /// constructor should be inkoved once again.
0839   bool shouldRepeatCtorCall(ProgramStateRef State, const CXXConstructExpr *E,
0840                             const LocationContext *LCtx);
0841 
0842   void inlineCall(WorkList *WList, const CallEvent &Call, const Decl *D,
0843                   NodeBuilder &Bldr, ExplodedNode *Pred, ProgramStateRef State);
0844 
0845   void ctuBifurcate(const CallEvent &Call, const Decl *D, NodeBuilder &Bldr,
0846                     ExplodedNode *Pred, ProgramStateRef State);
0847 
0848   /// Returns true if the CTU analysis is running its second phase.
0849   bool isSecondPhaseCTU() { return IsCTUEnabled && !Engine.getCTUWorkList(); }
0850 
0851   /// Conservatively evaluate call by invalidating regions and binding
0852   /// a conjured return value.
0853   void conservativeEvalCall(const CallEvent &Call, NodeBuilder &Bldr,
0854                             ExplodedNode *Pred, ProgramStateRef State);
0855 
0856   /// Either inline or process the call conservatively (or both), based
0857   /// on DynamicDispatchBifurcation data.
0858   void BifurcateCall(const MemRegion *BifurReg,
0859                      const CallEvent &Call, const Decl *D, NodeBuilder &Bldr,
0860                      ExplodedNode *Pred);
0861 
0862   bool replayWithoutInlining(ExplodedNode *P, const LocationContext *CalleeLC);
0863 
0864   /// Models a trivial copy or move constructor or trivial assignment operator
0865   /// call with a simple bind.
0866   void performTrivialCopy(NodeBuilder &Bldr, ExplodedNode *Pred,
0867                           const CallEvent &Call);
0868 
0869   /// If the value of the given expression \p InitWithAdjustments is a NonLoc,
0870   /// copy it into a new temporary object region, and replace the value of the
0871   /// expression with that.
0872   ///
0873   /// If \p Result is provided, the new region will be bound to this expression
0874   /// instead of \p InitWithAdjustments.
0875   ///
0876   /// Returns the temporary region with adjustments into the optional
0877   /// OutRegionWithAdjustments out-parameter if a new region was indeed needed,
0878   /// otherwise sets it to nullptr.
0879   ProgramStateRef createTemporaryRegionIfNeeded(
0880       ProgramStateRef State, const LocationContext *LC,
0881       const Expr *InitWithAdjustments, const Expr *Result = nullptr,
0882       const SubRegion **OutRegionWithAdjustments = nullptr);
0883 
0884   /// Returns a region representing the `Idx`th element of a (possibly
0885   /// multi-dimensional) array, for the purposes of element construction or
0886   /// destruction.
0887   ///
0888   /// On return, \p Ty will be set to the base type of the array.
0889   ///
0890   /// If the type is not an array type at all, the original value is returned.
0891   /// Otherwise the "IsArray" flag is set.
0892   static SVal makeElementRegion(ProgramStateRef State, SVal LValue,
0893                                 QualType &Ty, bool &IsArray, unsigned Idx = 0);
0894 
0895   /// Common code that handles either a CXXConstructExpr or a
0896   /// CXXInheritedCtorInitExpr.
0897   void handleConstructor(const Expr *E, ExplodedNode *Pred,
0898                          ExplodedNodeSet &Dst);
0899 
0900 public:
0901   /// Note whether this loop has any more iteratios to model. These methods are
0902   /// essentially an interface for a GDM trait. Further reading in
0903   /// ExprEngine::VisitObjCForCollectionStmt().
0904   [[nodiscard]] static ProgramStateRef
0905   setWhetherHasMoreIteration(ProgramStateRef State,
0906                              const ObjCForCollectionStmt *O,
0907                              const LocationContext *LC, bool HasMoreIteraton);
0908 
0909   [[nodiscard]] static ProgramStateRef
0910   removeIterationState(ProgramStateRef State, const ObjCForCollectionStmt *O,
0911                        const LocationContext *LC);
0912 
0913   [[nodiscard]] static bool hasMoreIteration(ProgramStateRef State,
0914                                              const ObjCForCollectionStmt *O,
0915                                              const LocationContext *LC);
0916 
0917 private:
0918   /// Assuming we construct an array of non-POD types, this method allows us
0919   /// to store which element is to be constructed next.
0920   static ProgramStateRef
0921   setIndexOfElementToConstruct(ProgramStateRef State, const CXXConstructExpr *E,
0922                                const LocationContext *LCtx, unsigned Idx);
0923 
0924   static ProgramStateRef
0925   removeIndexOfElementToConstruct(ProgramStateRef State,
0926                                   const CXXConstructExpr *E,
0927                                   const LocationContext *LCtx);
0928 
0929   /// Assuming we destruct an array of non-POD types, this method allows us
0930   /// to store which element is to be destructed next.
0931   static ProgramStateRef setPendingArrayDestruction(ProgramStateRef State,
0932                                                     const LocationContext *LCtx,
0933                                                     unsigned Idx);
0934 
0935   static ProgramStateRef
0936   removePendingArrayDestruction(ProgramStateRef State,
0937                                 const LocationContext *LCtx);
0938 
0939   /// Sets the size of the array in a pending ArrayInitLoopExpr.
0940   static ProgramStateRef setPendingInitLoop(ProgramStateRef State,
0941                                             const CXXConstructExpr *E,
0942                                             const LocationContext *LCtx,
0943                                             unsigned Idx);
0944 
0945   static ProgramStateRef removePendingInitLoop(ProgramStateRef State,
0946                                                const CXXConstructExpr *E,
0947                                                const LocationContext *LCtx);
0948 
0949   static ProgramStateRef
0950   removeStateTraitsUsedForArrayEvaluation(ProgramStateRef State,
0951                                           const CXXConstructExpr *E,
0952                                           const LocationContext *LCtx);
0953 
0954   /// Store the location of a C++ object corresponding to a statement
0955   /// until the statement is actually encountered. For example, if a DeclStmt
0956   /// has CXXConstructExpr as its initializer, the object would be considered
0957   /// to be "under construction" between CXXConstructExpr and DeclStmt.
0958   /// This allows, among other things, to keep bindings to variable's fields
0959   /// made within the constructor alive until its declaration actually
0960   /// goes into scope.
0961   static ProgramStateRef
0962   addObjectUnderConstruction(ProgramStateRef State,
0963                              const ConstructionContextItem &Item,
0964                              const LocationContext *LC, SVal V);
0965 
0966   /// Mark the object sa fully constructed, cleaning up the state trait
0967   /// that tracks objects under construction.
0968   static ProgramStateRef
0969   finishObjectConstruction(ProgramStateRef State,
0970                            const ConstructionContextItem &Item,
0971                            const LocationContext *LC);
0972 
0973   /// If the given expression corresponds to a temporary that was used for
0974   /// passing into an elidable copy/move constructor and that constructor
0975   /// was actually elided, track that we also need to elide the destructor.
0976   static ProgramStateRef elideDestructor(ProgramStateRef State,
0977                                          const CXXBindTemporaryExpr *BTE,
0978                                          const LocationContext *LC);
0979 
0980   /// Stop tracking the destructor that corresponds to an elided constructor.
0981   static ProgramStateRef
0982   cleanupElidedDestructor(ProgramStateRef State,
0983                           const CXXBindTemporaryExpr *BTE,
0984                           const LocationContext *LC);
0985 
0986   /// Returns true if the given expression corresponds to a temporary that
0987   /// was constructed for passing into an elidable copy/move constructor
0988   /// and that constructor was actually elided.
0989   static bool isDestructorElided(ProgramStateRef State,
0990                                  const CXXBindTemporaryExpr *BTE,
0991                                  const LocationContext *LC);
0992 
0993   /// Check if all objects under construction have been fully constructed
0994   /// for the given context range (including FromLC, not including ToLC).
0995   /// This is useful for assertions. Also checks if elided destructors
0996   /// were cleaned up.
0997   static bool areAllObjectsFullyConstructed(ProgramStateRef State,
0998                                             const LocationContext *FromLC,
0999                                             const LocationContext *ToLC);
1000 };
1001 
1002 /// Traits for storing the call processing policy inside GDM.
1003 /// The GDM stores the corresponding CallExpr pointer.
1004 // FIXME: This does not use the nice trait macros because it must be accessible
1005 // from multiple translation units.
1006 struct ReplayWithoutInlining{};
1007 template <>
1008 struct ProgramStateTrait<ReplayWithoutInlining> :
1009   public ProgramStatePartialTrait<const void*> {
1010   static void *GDMIndex();
1011 };
1012 
1013 } // namespace ento
1014 
1015 } // namespace clang
1016 
1017 #endif // LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_EXPRENGINE_H