From: Ted Kremenek Date: Thu, 19 Feb 2009 23:43:16 +0000 (+0000) Subject: ProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2680b5f926fad29c1a2b2723a70d189f4b637979;p=clang ProgramPoint::Profile now specially handles PostStmtCustom (hashes on tag and data) so that clients don't need a unique address for the pair itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65079 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index ee742634be..5d04351591 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -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(Data.first & ~Mask); } @@ -111,8 +111,15 @@ public: void Profile(llvm::FoldingSetNodeID& ID) const { ID.AddPointer(reinterpret_cast(Data.first)); - ID.AddPointer(reinterpret_cast(Data.second)); - } + if (getKind() != PostStmtCustomKind) + ID.AddPointer(reinterpret_cast(Data.second)); + else { + const std::pair *P = + reinterpret_cast*>(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* TaggedData) : PostStmt(S, TaggedData) {