Added a new method to GRStmtNodeBuilder to build nodes using an arbitrary
PostStmt program point. This allows clients to pass in PostStmtCustom program points. llvm-svn: 65080
This commit is contained in:
		
							parent
							
								
									406d2c17f5
								
							
						
					
					
						commit
						513f0b147e
					
				| 
						 | 
					@ -141,6 +141,9 @@ public:
 | 
				
			||||||
    return getBlockCounter().getNumVisited(B.getBlockID());
 | 
					    return getBlockCounter().getNumVisited(B.getBlockID());
 | 
				
			||||||
  }  
 | 
					  }  
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					  ExplodedNodeImpl*
 | 
				
			||||||
 | 
					  generateNodeImpl(PostStmt PP, const void* State, ExplodedNodeImpl* Pred);
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  ExplodedNodeImpl*
 | 
					  ExplodedNodeImpl*
 | 
				
			||||||
  generateNodeImpl(Stmt* S, const void* State, ExplodedNodeImpl* Pred,
 | 
					  generateNodeImpl(Stmt* S, const void* State, ExplodedNodeImpl* Pred,
 | 
				
			||||||
                   ProgramPoint::Kind K = ProgramPoint::PostStmtKind);
 | 
					                   ProgramPoint::Kind K = ProgramPoint::PostStmtKind);
 | 
				
			||||||
| 
						 | 
					@ -193,6 +196,10 @@ public:
 | 
				
			||||||
    return static_cast<NodeTy*>(NB.getLastNode());
 | 
					    return static_cast<NodeTy*>(NB.getLastNode());
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					  NodeTy* generateNode(PostStmt PP, const StateTy* St, NodeTy* Pred) {
 | 
				
			||||||
 | 
					    return static_cast<NodeTy*>(NB.generateNodeImpl(PP, St, Pred));
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  NodeTy* generateNode(Stmt* S, const StateTy* St, NodeTy* Pred,
 | 
					  NodeTy* generateNode(Stmt* S, const StateTy* St, NodeTy* Pred,
 | 
				
			||||||
                       ProgramPoint::Kind K) {
 | 
					                       ProgramPoint::Kind K) {
 | 
				
			||||||
    HasGeneratedNode = true;
 | 
					    HasGeneratedNode = true;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -368,7 +368,7 @@ void GRStmtNodeBuilderImpl::GenerateAutoTransition(ExplodedNodeImpl* N) {
 | 
				
			||||||
    Eng.WList->Enqueue(Succ, B, Idx+1);
 | 
					    Eng.WList->Enqueue(Succ, B, Idx+1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static inline ProgramPoint GetPostLoc(Stmt* S, ProgramPoint::Kind K) {
 | 
					static inline PostStmt GetPostLoc(Stmt* S, ProgramPoint::Kind K) {
 | 
				
			||||||
  switch (K) {
 | 
					  switch (K) {
 | 
				
			||||||
    default:
 | 
					    default:
 | 
				
			||||||
      assert(false && "Invalid PostXXXKind.");
 | 
					      assert(false && "Invalid PostXXXKind.");
 | 
				
			||||||
| 
						 | 
					@ -403,10 +403,13 @@ ExplodedNodeImpl*
 | 
				
			||||||
GRStmtNodeBuilderImpl::generateNodeImpl(Stmt* S, const void* State,
 | 
					GRStmtNodeBuilderImpl::generateNodeImpl(Stmt* S, const void* State,
 | 
				
			||||||
                                        ExplodedNodeImpl* Pred,
 | 
					                                        ExplodedNodeImpl* Pred,
 | 
				
			||||||
                                        ProgramPoint::Kind K) {
 | 
					                                        ProgramPoint::Kind K) {
 | 
				
			||||||
  
 | 
					  return generateNodeImpl(GetPostLoc(S, K), State, Pred); 
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ExplodedNodeImpl*
 | 
				
			||||||
 | 
					GRStmtNodeBuilderImpl::generateNodeImpl(PostStmt Loc, const void* State,
 | 
				
			||||||
 | 
					                                        ExplodedNodeImpl* Pred) {  
 | 
				
			||||||
  bool IsNew;
 | 
					  bool IsNew;
 | 
				
			||||||
  ProgramPoint Loc = GetPostLoc(S, K);
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  ExplodedNodeImpl* N = Eng.G->getNodeImpl(Loc, State, &IsNew);
 | 
					  ExplodedNodeImpl* N = Eng.G->getNodeImpl(Loc, State, &IsNew);
 | 
				
			||||||
  N->addPredecessor(Pred);
 | 
					  N->addPredecessor(Pred);
 | 
				
			||||||
  Deferred.erase(Pred);
 | 
					  Deferred.erase(Pred);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue