diff options
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp | 7 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 10 |
2 files changed, 14 insertions, 3 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp index 68e47af1086..66944c616b9 100644 --- a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp @@ -283,6 +283,13 @@ ExplodedNode * const *ExplodedNode::NodeGroup::end() const { return Storage.getAddrOfPtr1() + 1; } +int64_t ExplodedNode::getID(ExplodedGraph *G) const { + Optional<int64_t> Out = G->getAllocator().identifyObject(this); + assert(Out && "Wrong allocator used"); + assert(*Out % alignof(ExplodedNode) == 0 && "Wrong alignment information"); + return *Out / alignof(ExplodedNode); +} + ExplodedNode *ExplodedGraph::getNode(const ProgramPoint &L, ProgramStateRef State, bool IsSink, diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index a9901a6cd7d..7f13c7f0a05 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -3141,9 +3141,13 @@ struct DOTGraphTraits<ExplodedNode*> : public DefaultDOTGraphTraits { } ProgramStateRef state = N->getState(); - Out << "\\|StateID: " << state->getID() << " (" - << (const void*) state.get() << ")" - << " NodeID: " << (const void*) N << "\\|"; + ExplodedGraph &Graph = + static_cast<ExprEngine *>(state->getStateManager().getOwningEngine()) + ->getGraph(); + + Out << "\\|StateID: " << state->getID() << " (" << (const void *)state.get() + << ")" + << " NodeID: " << N->getID(&Graph) << " (" << (const void *)N << ")\\|"; state->printDOT(Out, N->getLocationContext()); |