aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/ProgramPoint.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-19 23:43:16 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-19 23:43:16 +0000
commit2680b5f926fad29c1a2b2723a70d189f4b637979 (patch)
tree5b3b2717ba6bb837603e1a396ec430e1f7a515cd /include/clang/Analysis/ProgramPoint.h
parent08eddd946628718e1832d98fc292610252c78a62 (diff)
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
Diffstat (limited to 'include/clang/Analysis/ProgramPoint.h')
-rw-r--r--include/clang/Analysis/ProgramPoint.h14
1 files changed, 11 insertions, 3 deletions
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<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) {