]> granicus.if.org Git - clang/commitdiff
ProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data...
authorTed Kremenek <kremenek@apple.com>
Thu, 19 Feb 2009 23:43:16 +0000 (23:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 19 Feb 2009 23:43:16 +0000 (23:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65079 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/ProgramPoint.h

index ee742634bef6bac7c17ff3aaa439dd5bebcd65cf..5d04351591df9c10e8069527280cc47613c113ab 100644 (file)
@@ -69,7 +69,7 @@ protected:
   
   void* getData1() const {
     Kind k = getKind(); k = k;
-    assert(k == BlockEdgeKind || (k >= MinPostStmtKind && k < MaxPostStmtKind));
+    assert(k == BlockEdgeKind ||(k >= MinPostStmtKind && k <= MaxPostStmtKind));
     return reinterpret_cast<void*>(Data.first & ~Mask);
   }
 
@@ -111,8 +111,15 @@ public:
   
   void Profile(llvm::FoldingSetNodeID& ID) const {
     ID.AddPointer(reinterpret_cast<void*>(Data.first));
-    ID.AddPointer(reinterpret_cast<void*>(Data.second));
-  }    
+    if (getKind() != PostStmtCustomKind)
+      ID.AddPointer(reinterpret_cast<void*>(Data.second));
+    else {
+      const std::pair<const void*, const void*> *P = 
+        reinterpret_cast<std::pair<const void*, const void*>*>(Data.second);
+      ID.AddPointer(P->first);
+      ID.AddPointer(P->second);
+    }
+  }
 };
                
 class BlockEntrance : public ProgramPoint {
@@ -183,6 +190,7 @@ public:
 };
   
 class PostStmtCustom : public PostStmt {
+public:
   PostStmtCustom(const Stmt* S,
                  const std::pair<const void*, const void*>* TaggedData)
     : PostStmt(S, TaggedData) {