]> granicus.if.org Git - clang/commitdiff
Make BlockEntrace program points taggable.
authorTed Kremenek <kremenek@apple.com>
Fri, 8 May 2009 23:08:34 +0000 (23:08 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 8 May 2009 23:08:34 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71280 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/GRCoreEngine.h
include/clang/Analysis/ProgramPoint.h
lib/Analysis/GRCoreEngine.cpp

index 93c2884f8b184e2788ee42219d42603a6526b69a..6a32a22a0422512aa126a48f163ab12411a9a8a8 100644 (file)
@@ -539,7 +539,9 @@ public:
     return getBlockCounter().getNumVisited(B.getBlockID());
   }  
   
-  ExplodedNodeImpl* generateNodeImpl(const void* State);
+  ExplodedNodeImpl* generateNodeImpl(const void* State,
+                                     const void *tag = 0,
+                                     ExplodedNodeImpl *P = 0);
     
   CFGBlock* getBlock() const { return &B; }
 };
@@ -571,9 +573,13 @@ public:
     return getPredecessor()->getState();
   }
   
-  NodeTy* MakeNode(const StateTy* St) {  
-    return static_cast<NodeTy*>(NB.generateNodeImpl(St));
+  NodeTy* MakeNode(const StateTy* St, const void *tag = 0) {  
+    return static_cast<NodeTy*>(NB.generateNodeImpl(St, tag));
   }
+  
+  NodeTy *generateNode(const StateTy *St, NodeTy *Pred, const void *tag = 0) {
+    return static_cast<NodeTy*>(NB.generateNodeImpl(St, tag, Pred));
+  }                                
 };
 
   
index 074a2620381c7f23f295bbda7c3294a4c78978b4..8e6d5ec8316c157666ceac2bbdbea97e90b6d0c6 100644 (file)
@@ -131,7 +131,8 @@ public:
                
 class BlockEntrance : public ProgramPoint {
 public:
-  BlockEntrance(const CFGBlock* B) : ProgramPoint(B, BlockEntranceKind) {}
+  BlockEntrance(const CFGBlock* B, const void *tag = 0)
+    : ProgramPoint(B, BlockEntranceKind, tag) {}
     
   CFGBlock* getBlock() const {
     return reinterpret_cast<CFGBlock*>(getData1NoMask());
index 8bbf71e90a425b80cf4e47d977770814032377b1..c75fd9ace1b7ffba7743411ac7a10508425e9133 100644 (file)
@@ -555,16 +555,17 @@ GREndPathNodeBuilderImpl::~GREndPathNodeBuilderImpl() {
   if (!HasGeneratedNode) generateNodeImpl(Pred->State);
 }
 
-ExplodedNodeImpl* GREndPathNodeBuilderImpl::generateNodeImpl(const void* State){
-  HasGeneratedNode = true;
-    
+ExplodedNodeImpl*
+GREndPathNodeBuilderImpl::generateNodeImpl(const void* State,
+                                           const void *tag,
+                                           ExplodedNodeImpl* P) {
+  HasGeneratedNode = true;    
   bool IsNew;
   
   ExplodedNodeImpl* Node =
-    Eng.G->getNodeImpl(BlockEntrance(&B), State, &IsNew);
+    Eng.G->getNodeImpl(BlockEntrance(&B, tag), State, &IsNew);
   
-
-  Node->addPredecessor(Pred);
+  Node->addPredecessor(P ? P : Pred);
   
   if (IsNew) {
     Node->markAsSink();