[cfe-commits] r65079 - /cfe/trunk/include/clang/Analysis/ProgramPoint.h

Ted Kremenek kremenek at apple.com
Thu Feb 19 15:43:16 PST 2009


Author: kremenek
Date: Thu Feb 19 17:43:16 2009
New Revision: 65079

URL: http://llvm.org/viewvc/llvm-project?rev=65079&view=rev
Log:
ProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data) so that clients don't need a unique address for the pair itself.

Modified:
    cfe/trunk/include/clang/Analysis/ProgramPoint.h

Modified: cfe/trunk/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/ProgramPoint.h?rev=65079&r1=65078&r2=65079&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/trunk/include/clang/Analysis/ProgramPoint.h Thu Feb 19 17:43:16 2009
@@ -69,7 +69,7 @@
   
   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 @@
   
   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 @@
 };
   
 class PostStmtCustom : public PostStmt {
+public:
   PostStmtCustom(const Stmt* S,
                  const std::pair<const void*, const void*>* TaggedData)
     : PostStmt(S, TaggedData) {





More information about the cfe-commits mailing list