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