ExprEngine.h revision 30a2e16f6c27f888dd11eba6bbbae1e980078fcb
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_GR_EXPRENGINE 17#define LLVM_CLANG_GR_EXPRENGINE 18 19#include "clang/AST/Expr.h" 20#include "clang/AST/Type.h" 21#include "clang/Analysis/DomainSpecific/ObjCNoReturn.h" 22#include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h" 23#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h" 24#include "clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h" 25#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" 26#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h" 27#include "clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h" 28 29namespace clang { 30 31class AnalysisDeclContextManager; 32class CXXCatchStmt; 33class CXXConstructExpr; 34class CXXDeleteExpr; 35class CXXNewExpr; 36class CXXTemporaryObjectExpr; 37class CXXThisExpr; 38class MaterializeTemporaryExpr; 39class ObjCAtSynchronizedStmt; 40class ObjCForCollectionStmt; 41 42namespace ento { 43 44class AnalysisManager; 45class CallEvent; 46class SimpleCall; 47 48class ExprEngine : public SubEngine { 49 AnalysisManager &AMgr; 50 51 AnalysisDeclContextManager &AnalysisDeclContexts; 52 53 CoreEngine Engine; 54 55 /// G - the simulation graph. 56 ExplodedGraph& G; 57 58 /// StateMgr - Object that manages the data for all created states. 59 ProgramStateManager StateMgr; 60 61 /// SymMgr - Object that manages the symbol information. 62 SymbolManager& SymMgr; 63 64 /// svalBuilder - SValBuilder object that creates SVals from expressions. 65 SValBuilder &svalBuilder; 66 67 /// EntryNode - The immediate predecessor node. 68 ExplodedNode *EntryNode; 69 70 /// CleanedState - The state for EntryNode "cleaned" of all dead 71 /// variables and symbols (as determined by a liveness analysis). 72 ProgramStateRef CleanedState; 73 74 /// currStmt - The current block-level statement. 75 const Stmt *currStmt; 76 unsigned int currStmtIdx; 77 const NodeBuilderContext *currBldrCtx; 78 79 /// Helper object to determine if an Objective-C message expression 80 /// implicitly never returns. 81 ObjCNoReturn ObjCNoRet; 82 83 /// Whether or not GC is enabled in this analysis. 84 bool ObjCGCEnabled; 85 86 /// The BugReporter associated with this engine. It is important that 87 /// this object be placed at the very end of member variables so that its 88 /// destructor is called before the rest of the ExprEngine is destroyed. 89 GRBugReporter BR; 90 91 /// The functions which have been analyzed through inlining. This is owned by 92 /// AnalysisConsumer. It can be null. 93 SetOfConstDecls *VisitedCallees; 94 95public: 96 ExprEngine(AnalysisManager &mgr, bool gcEnabled, 97 SetOfConstDecls *VisitedCalleesIn, 98 FunctionSummariesTy *FS); 99 100 ~ExprEngine(); 101 102 /// Returns true if there is still simulation state on the worklist. 103 bool ExecuteWorkList(const LocationContext *L, unsigned Steps = 150000) { 104 return Engine.ExecuteWorkList(L, Steps, 0); 105 } 106 107 /// Execute the work list with an initial state. Nodes that reaches the exit 108 /// of the function are added into the Dst set, which represent the exit 109 /// state of the function call. Returns true if there is still simulation 110 /// state on the worklist. 111 bool ExecuteWorkListWithInitialState(const LocationContext *L, unsigned Steps, 112 ProgramStateRef InitState, 113 ExplodedNodeSet &Dst) { 114 return Engine.ExecuteWorkListWithInitialState(L, Steps, InitState, Dst); 115 } 116 117 /// getContext - Return the ASTContext associated with this analysis. 118 ASTContext &getContext() const { return AMgr.getASTContext(); } 119 120 virtual AnalysisManager &getAnalysisManager() { return AMgr; } 121 122 CheckerManager &getCheckerManager() const { 123 return *AMgr.getCheckerManager(); 124 } 125 126 SValBuilder &getSValBuilder() { return svalBuilder; } 127 128 BugReporter& getBugReporter() { return BR; } 129 130 const NodeBuilderContext &getBuilderContext() { 131 assert(currBldrCtx); 132 return *currBldrCtx; 133 } 134 135 bool isObjCGCEnabled() { return ObjCGCEnabled; } 136 137 const Stmt *getStmt() const; 138 139 void GenerateAutoTransition(ExplodedNode *N); 140 void enqueueEndOfPath(ExplodedNodeSet &S); 141 void GenerateCallExitNode(ExplodedNode *N); 142 143 /// ViewGraph - Visualize the ExplodedGraph created by executing the 144 /// simulation. 145 void ViewGraph(bool trim = false); 146 147 void ViewGraph(ExplodedNode** Beg, ExplodedNode** End); 148 149 /// getInitialState - Return the initial state used for the root vertex 150 /// in the ExplodedGraph. 151 ProgramStateRef getInitialState(const LocationContext *InitLoc); 152 153 ExplodedGraph& getGraph() { return G; } 154 const ExplodedGraph& getGraph() const { return G; } 155 156 /// \brief Run the analyzer's garbage collection - remove dead symbols and 157 /// bindings from the state. 158 /// 159 /// Checkers can participate in this process with two callbacks: 160 /// \c checkLiveSymbols and \c checkDeadSymbols. See the CheckerDocumentation 161 /// class for more information. 162 /// 163 /// \param Node The predecessor node, from which the processing should start. 164 /// \param Out The returned set of output nodes. 165 /// \param ReferenceStmt The statement which is about to be processed. 166 /// Everything needed for this statement should be considered live. 167 /// A null statement means that everything in child LocationContexts 168 /// is dead. 169 /// \param LC The location context of the \p ReferenceStmt. A null location 170 /// context means that we have reached the end of analysis and that 171 /// all statements and local variables should be considered dead. 172 /// \param DiagnosticStmt Used as a location for any warnings that should 173 /// occur while removing the dead (e.g. leaks). By default, the 174 /// \p ReferenceStmt is used. 175 /// \param K Denotes whether this is a pre- or post-statement purge. This 176 /// must only be ProgramPoint::PostStmtPurgeDeadSymbolsKind if an 177 /// entire location context is being cleared, in which case the 178 /// \p ReferenceStmt must either be a ReturnStmt or \c NULL. Otherwise, 179 /// it must be ProgramPoint::PreStmtPurgeDeadSymbolsKind (the default) 180 /// and \p ReferenceStmt must be valid (non-null). 181 void removeDead(ExplodedNode *Node, ExplodedNodeSet &Out, 182 const Stmt *ReferenceStmt, const LocationContext *LC, 183 const Stmt *DiagnosticStmt = 0, 184 ProgramPoint::Kind K = ProgramPoint::PreStmtPurgeDeadSymbolsKind); 185 186 /// processCFGElement - Called by CoreEngine. Used to generate new successor 187 /// nodes by processing the 'effects' of a CFG element. 188 void processCFGElement(const CFGElement E, ExplodedNode *Pred, 189 unsigned StmtIdx, NodeBuilderContext *Ctx); 190 191 void ProcessStmt(const CFGStmt S, ExplodedNode *Pred); 192 193 void ProcessInitializer(const CFGInitializer I, ExplodedNode *Pred); 194 195 void ProcessImplicitDtor(const CFGImplicitDtor D, ExplodedNode *Pred); 196 197 void ProcessAutomaticObjDtor(const CFGAutomaticObjDtor D, 198 ExplodedNode *Pred, ExplodedNodeSet &Dst); 199 void ProcessBaseDtor(const CFGBaseDtor D, 200 ExplodedNode *Pred, ExplodedNodeSet &Dst); 201 void ProcessMemberDtor(const CFGMemberDtor D, 202 ExplodedNode *Pred, ExplodedNodeSet &Dst); 203 void ProcessTemporaryDtor(const CFGTemporaryDtor D, 204 ExplodedNode *Pred, ExplodedNodeSet &Dst); 205 206 /// Called by CoreEngine when processing the entrance of a CFGBlock. 207 virtual void processCFGBlockEntrance(const BlockEdge &L, 208 NodeBuilderWithSinks &nodeBuilder, 209 ExplodedNode *Pred); 210 211 /// ProcessBranch - Called by CoreEngine. Used to generate successor 212 /// nodes by processing the 'effects' of a branch condition. 213 void processBranch(const Stmt *Condition, const Stmt *Term, 214 NodeBuilderContext& BuilderCtx, 215 ExplodedNode *Pred, 216 ExplodedNodeSet &Dst, 217 const CFGBlock *DstT, 218 const CFGBlock *DstF); 219 220 /// processIndirectGoto - Called by CoreEngine. Used to generate successor 221 /// nodes by processing the 'effects' of a computed goto jump. 222 void processIndirectGoto(IndirectGotoNodeBuilder& builder); 223 224 /// ProcessSwitch - Called by CoreEngine. Used to generate successor 225 /// nodes by processing the 'effects' of a switch statement. 226 void processSwitch(SwitchNodeBuilder& builder); 227 228 /// ProcessEndPath - Called by CoreEngine. Used to generate end-of-path 229 /// nodes when the control reaches the end of a function. 230 void processEndOfFunction(NodeBuilderContext& BC, 231 ExplodedNode *Pred); 232 233 /// Remove dead bindings/symbols before exiting a function. 234 void removeDeadOnEndOfFunction(NodeBuilderContext& BC, 235 ExplodedNode *Pred, 236 ExplodedNodeSet &Dst); 237 238 /// Generate the entry node of the callee. 239 void processCallEnter(CallEnter CE, ExplodedNode *Pred); 240 241 /// Generate the sequence of nodes that simulate the call exit and the post 242 /// visit for CallExpr. 243 void processCallExit(ExplodedNode *Pred); 244 245 /// Called by CoreEngine when the analysis worklist has terminated. 246 void processEndWorklist(bool hasWorkRemaining); 247 248 /// evalAssume - Callback function invoked by the ConstraintManager when 249 /// making assumptions about state values. 250 ProgramStateRef processAssume(ProgramStateRef state, SVal cond,bool assumption); 251 252 /// wantsRegionChangeUpdate - Called by ProgramStateManager to determine if a 253 /// region change should trigger a processRegionChanges update. 254 bool wantsRegionChangeUpdate(ProgramStateRef state); 255 256 /// processRegionChanges - Called by ProgramStateManager whenever a change is made 257 /// to the store. Used to update checkers that track region values. 258 ProgramStateRef 259 processRegionChanges(ProgramStateRef state, 260 const StoreManager::InvalidatedSymbols *invalidated, 261 ArrayRef<const MemRegion *> ExplicitRegions, 262 ArrayRef<const MemRegion *> Regions, 263 const CallEvent *Call); 264 265 /// printState - Called by ProgramStateManager to print checker-specific data. 266 void printState(raw_ostream &Out, ProgramStateRef State, 267 const char *NL, const char *Sep); 268 269 virtual ProgramStateManager& getStateManager() { return StateMgr; } 270 271 StoreManager& getStoreManager() { return StateMgr.getStoreManager(); } 272 273 ConstraintManager& getConstraintManager() { 274 return StateMgr.getConstraintManager(); 275 } 276 277 // FIXME: Remove when we migrate over to just using SValBuilder. 278 BasicValueFactory& getBasicVals() { 279 return StateMgr.getBasicVals(); 280 } 281 282 // FIXME: Remove when we migrate over to just using ValueManager. 283 SymbolManager& getSymbolManager() { return SymMgr; } 284 const SymbolManager& getSymbolManager() const { return SymMgr; } 285 286 // Functions for external checking of whether we have unfinished work 287 bool wasBlocksExhausted() const { return Engine.wasBlocksExhausted(); } 288 bool hasEmptyWorkList() const { return !Engine.getWorkList()->hasWork(); } 289 bool hasWorkRemaining() const { return Engine.hasWorkRemaining(); } 290 291 const CoreEngine &getCoreEngine() const { return Engine; } 292 293public: 294 /// Visit - Transfer function logic for all statements. Dispatches to 295 /// other functions that handle specific kinds of statements. 296 void Visit(const Stmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst); 297 298 /// VisitArraySubscriptExpr - Transfer function for array accesses. 299 void VisitLvalArraySubscriptExpr(const ArraySubscriptExpr *Ex, 300 ExplodedNode *Pred, 301 ExplodedNodeSet &Dst); 302 303 /// VisitGCCAsmStmt - Transfer function logic for inline asm. 304 void VisitGCCAsmStmt(const GCCAsmStmt *A, ExplodedNode *Pred, 305 ExplodedNodeSet &Dst); 306 307 /// VisitMSAsmStmt - Transfer function logic for MS inline asm. 308 void VisitMSAsmStmt(const MSAsmStmt *A, ExplodedNode *Pred, 309 ExplodedNodeSet &Dst); 310 311 /// VisitBlockExpr - Transfer function logic for BlockExprs. 312 void VisitBlockExpr(const BlockExpr *BE, ExplodedNode *Pred, 313 ExplodedNodeSet &Dst); 314 315 /// VisitBinaryOperator - Transfer function logic for binary operators. 316 void VisitBinaryOperator(const BinaryOperator* B, ExplodedNode *Pred, 317 ExplodedNodeSet &Dst); 318 319 320 /// VisitCall - Transfer function for function calls. 321 void VisitCallExpr(const CallExpr *CE, ExplodedNode *Pred, 322 ExplodedNodeSet &Dst); 323 324 /// VisitCast - Transfer function logic for all casts (implicit and explicit). 325 void VisitCast(const CastExpr *CastE, const Expr *Ex, ExplodedNode *Pred, 326 ExplodedNodeSet &Dst); 327 328 /// VisitCompoundLiteralExpr - Transfer function logic for compound literals. 329 void VisitCompoundLiteralExpr(const CompoundLiteralExpr *CL, 330 ExplodedNode *Pred, ExplodedNodeSet &Dst); 331 332 /// Transfer function logic for DeclRefExprs and BlockDeclRefExprs. 333 void VisitCommonDeclRefExpr(const Expr *DR, const NamedDecl *D, 334 ExplodedNode *Pred, ExplodedNodeSet &Dst); 335 336 /// VisitDeclStmt - Transfer function logic for DeclStmts. 337 void VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred, 338 ExplodedNodeSet &Dst); 339 340 /// VisitGuardedExpr - Transfer function logic for ?, __builtin_choose 341 void VisitGuardedExpr(const Expr *Ex, const Expr *L, const Expr *R, 342 ExplodedNode *Pred, ExplodedNodeSet &Dst); 343 344 void VisitInitListExpr(const InitListExpr *E, ExplodedNode *Pred, 345 ExplodedNodeSet &Dst); 346 347 /// VisitLogicalExpr - Transfer function logic for '&&', '||' 348 void VisitLogicalExpr(const BinaryOperator* B, ExplodedNode *Pred, 349 ExplodedNodeSet &Dst); 350 351 /// VisitMemberExpr - Transfer function for member expressions. 352 void VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred, 353 ExplodedNodeSet &Dst); 354 355 /// Transfer function logic for ObjCAtSynchronizedStmts. 356 void VisitObjCAtSynchronizedStmt(const ObjCAtSynchronizedStmt *S, 357 ExplodedNode *Pred, ExplodedNodeSet &Dst); 358 359 /// Transfer function logic for computing the lvalue of an Objective-C ivar. 360 void VisitLvalObjCIvarRefExpr(const ObjCIvarRefExpr *DR, ExplodedNode *Pred, 361 ExplodedNodeSet &Dst); 362 363 /// VisitObjCForCollectionStmt - Transfer function logic for 364 /// ObjCForCollectionStmt. 365 void VisitObjCForCollectionStmt(const ObjCForCollectionStmt *S, 366 ExplodedNode *Pred, ExplodedNodeSet &Dst); 367 368 void VisitObjCMessage(const ObjCMessageExpr *ME, ExplodedNode *Pred, 369 ExplodedNodeSet &Dst); 370 371 /// VisitReturnStmt - Transfer function logic for return statements. 372 void VisitReturnStmt(const ReturnStmt *R, ExplodedNode *Pred, 373 ExplodedNodeSet &Dst); 374 375 /// VisitOffsetOfExpr - Transfer function for offsetof. 376 void VisitOffsetOfExpr(const OffsetOfExpr *Ex, ExplodedNode *Pred, 377 ExplodedNodeSet &Dst); 378 379 /// VisitUnaryExprOrTypeTraitExpr - Transfer function for sizeof. 380 void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Ex, 381 ExplodedNode *Pred, ExplodedNodeSet &Dst); 382 383 /// VisitUnaryOperator - Transfer function logic for unary operators. 384 void VisitUnaryOperator(const UnaryOperator* B, ExplodedNode *Pred, 385 ExplodedNodeSet &Dst); 386 387 /// Handle ++ and -- (both pre- and post-increment). 388 void VisitIncrementDecrementOperator(const UnaryOperator* U, 389 ExplodedNode *Pred, 390 ExplodedNodeSet &Dst); 391 392 void VisitCXXCatchStmt(const CXXCatchStmt *CS, ExplodedNode *Pred, 393 ExplodedNodeSet &Dst); 394 395 void VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred, 396 ExplodedNodeSet & Dst); 397 398 void VisitCXXConstructExpr(const CXXConstructExpr *E, ExplodedNode *Pred, 399 ExplodedNodeSet &Dst); 400 401 void VisitCXXDestructor(QualType ObjectType, const MemRegion *Dest, 402 const Stmt *S, bool IsBaseDtor, 403 ExplodedNode *Pred, ExplodedNodeSet &Dst); 404 405 void VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred, 406 ExplodedNodeSet &Dst); 407 408 void VisitCXXDeleteExpr(const CXXDeleteExpr *CDE, ExplodedNode *Pred, 409 ExplodedNodeSet &Dst); 410 411 /// Create a C++ temporary object for an rvalue. 412 void CreateCXXTemporaryObject(const MaterializeTemporaryExpr *ME, 413 ExplodedNode *Pred, 414 ExplodedNodeSet &Dst); 415 416 /// evalEagerlyAssumeBinOpBifurcation - Given the nodes in 'Src', eagerly assume symbolic 417 /// expressions of the form 'x != 0' and generate new nodes (stored in Dst) 418 /// with those assumptions. 419 void evalEagerlyAssumeBinOpBifurcation(ExplodedNodeSet &Dst, ExplodedNodeSet &Src, 420 const Expr *Ex); 421 422 std::pair<const ProgramPointTag *, const ProgramPointTag*> 423 geteagerlyAssumeBinOpBifurcationTags(); 424 425 SVal evalMinus(SVal X) { 426 return X.isValid() ? svalBuilder.evalMinus(cast<NonLoc>(X)) : X; 427 } 428 429 SVal evalComplement(SVal X) { 430 return X.isValid() ? svalBuilder.evalComplement(cast<NonLoc>(X)) : X; 431 } 432 433public: 434 435 SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, 436 NonLoc L, NonLoc R, QualType T) { 437 return svalBuilder.evalBinOpNN(state, op, L, R, T); 438 } 439 440 SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, 441 NonLoc L, SVal R, QualType T) { 442 return R.isValid() ? svalBuilder.evalBinOpNN(state,op,L, cast<NonLoc>(R), T) : R; 443 } 444 445 SVal evalBinOp(ProgramStateRef ST, BinaryOperator::Opcode Op, 446 SVal LHS, SVal RHS, QualType T) { 447 return svalBuilder.evalBinOp(ST, Op, LHS, RHS, T); 448 } 449 450protected: 451 /// evalBind - Handle the semantics of binding a value to a specific location. 452 /// This method is used by evalStore, VisitDeclStmt, and others. 453 void evalBind(ExplodedNodeSet &Dst, const Stmt *StoreE, ExplodedNode *Pred, 454 SVal location, SVal Val, bool atDeclInit = false, 455 const ProgramPoint *PP = 0); 456 457public: 458 // FIXME: 'tag' should be removed, and a LocationContext should be used 459 // instead. 460 // FIXME: Comment on the meaning of the arguments, when 'St' may not 461 // be the same as Pred->state, and when 'location' may not be the 462 // same as state->getLValue(Ex). 463 /// Simulate a read of the result of Ex. 464 void evalLoad(ExplodedNodeSet &Dst, 465 const Expr *NodeEx, /* Eventually will be a CFGStmt */ 466 const Expr *BoundExpr, 467 ExplodedNode *Pred, 468 ProgramStateRef St, 469 SVal location, 470 const ProgramPointTag *tag = 0, 471 QualType LoadTy = QualType()); 472 473 // FIXME: 'tag' should be removed, and a LocationContext should be used 474 // instead. 475 void evalStore(ExplodedNodeSet &Dst, const Expr *AssignE, const Expr *StoreE, 476 ExplodedNode *Pred, ProgramStateRef St, SVal TargetLV, SVal Val, 477 const ProgramPointTag *tag = 0); 478 479 /// \brief Create a new state in which the call return value is binded to the 480 /// call origin expression. 481 ProgramStateRef bindReturnValue(const CallEvent &Call, 482 const LocationContext *LCtx, 483 ProgramStateRef State); 484 485 /// Evaluate a call, running pre- and post-call checks and allowing checkers 486 /// to be responsible for handling the evaluation of the call itself. 487 void evalCall(ExplodedNodeSet &Dst, ExplodedNode *Pred, 488 const CallEvent &Call); 489 490 /// \brief Default implementation of call evaluation. 491 void defaultEvalCall(NodeBuilder &B, ExplodedNode *Pred, 492 const CallEvent &Call); 493private: 494 void evalLoadCommon(ExplodedNodeSet &Dst, 495 const Expr *NodeEx, /* Eventually will be a CFGStmt */ 496 const Expr *BoundEx, 497 ExplodedNode *Pred, 498 ProgramStateRef St, 499 SVal location, 500 const ProgramPointTag *tag, 501 QualType LoadTy); 502 503 // FIXME: 'tag' should be removed, and a LocationContext should be used 504 // instead. 505 void evalLocation(ExplodedNodeSet &Dst, 506 const Stmt *NodeEx, /* This will eventually be a CFGStmt */ 507 const Stmt *BoundEx, 508 ExplodedNode *Pred, 509 ProgramStateRef St, SVal location, 510 const ProgramPointTag *tag, bool isLoad); 511 512 /// Count the stack depth and determine if the call is recursive. 513 void examineStackFrames(const Decl *D, const LocationContext *LCtx, 514 bool &IsRecursive, unsigned &StackDepth); 515 516 bool shouldInlineDecl(const Decl *D, ExplodedNode *Pred); 517 bool inlineCall(const CallEvent &Call, const Decl *D, NodeBuilder &Bldr, 518 ExplodedNode *Pred, ProgramStateRef State); 519 520 /// \brief Conservatively evaluate call by invalidating regions and binding 521 /// a conjured return value. 522 void conservativeEvalCall(const CallEvent &Call, NodeBuilder &Bldr, 523 ExplodedNode *Pred, ProgramStateRef State); 524 525 /// \brief Either inline or process the call conservatively (or both), based 526 /// on DynamicDispatchBifurcation data. 527 void BifurcateCall(const MemRegion *BifurReg, 528 const CallEvent &Call, const Decl *D, NodeBuilder &Bldr, 529 ExplodedNode *Pred); 530 531 bool replayWithoutInlining(ExplodedNode *P, const LocationContext *CalleeLC); 532}; 533 534/// Traits for storing the call processing policy inside GDM. 535/// The GDM stores the corresponding CallExpr pointer. 536// FIXME: This does not use the nice trait macros because it must be accessible 537// from multiple translation units. 538struct ReplayWithoutInlining{}; 539template <> 540struct ProgramStateTrait<ReplayWithoutInlining> : 541 public ProgramStatePartialTrait<void*> { 542 static void *GDMIndex() { static int index = 0; return &index; } 543}; 544 545} // end ento namespace 546 547} // end clang namespace 548 549#endif 550