aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Analysis/PathSensitive/ExplodedGraph.h13
-rw-r--r--include/clang/Analysis/PathSensitive/ValueState.h6
2 files changed, 14 insertions, 5 deletions
diff --git a/include/clang/Analysis/PathSensitive/ExplodedGraph.h b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
index a56e7d3d14..db5f692699 100644
--- a/include/clang/Analysis/PathSensitive/ExplodedGraph.h
+++ b/include/clang/Analysis/PathSensitive/ExplodedGraph.h
@@ -162,8 +162,16 @@ public:
}
// Profiling (for FoldingSet).
+
+ static inline void Profile(llvm::FoldingSetNodeID& ID,
+ const ProgramPoint& Loc,
+ StateTy state) {
+ ID.Add(Loc);
+ GRTrait<StateTy>::Profile(ID, state);
+ }
+
inline void Profile(llvm::FoldingSetNodeID& ID) const {
- GRTrait<StateTy>::Profile(ID, getState());
+ Profile(ID, getLocation(), getState());
}
// Iterators over successor and predecessor vertices.
@@ -307,8 +315,7 @@ public:
llvm::FoldingSetNodeID profile;
void* InsertPos = 0;
- GRTrait<StateTy>::Profile(profile, State);
- profile.Add(L);
+ NodeTy::Profile(profile, L, State);
NodeTy* V = Nodes.FindNodeOrInsertPos(profile, InsertPos);
if (!V) {
diff --git a/include/clang/Analysis/PathSensitive/ValueState.h b/include/clang/Analysis/PathSensitive/ValueState.h
index 73c4706db1..ba323b5a86 100644
--- a/include/clang/Analysis/PathSensitive/ValueState.h
+++ b/include/clang/Analysis/PathSensitive/ValueState.h
@@ -145,8 +145,10 @@ public:
template<> struct GRTrait<ValueState*> {
static inline void* toPtr(ValueState* St) { return (void*) St; }
static inline ValueState* toState(void* P) { return (ValueState*) P; }
- static inline void Profile(llvm::FoldingSetNodeID& profile, ValueState* St) {
- ValueState::Profile(profile, St);
+ static inline void Profile(llvm::FoldingSetNodeID& profile, ValueState* St) {
+ // At this point states have already been uniqued. Just
+ // add the pointer.
+ profile.AddPointer(St);
}
};