Index: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h =================================================================== --- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h +++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h @@ -240,6 +240,8 @@ return const_cast(this)->succ_end(); } + int64_t getID(ExplodedGraph *G) const; + private: void replaceSuccessor(ExplodedNode *node) { Succs.replaceNode(node); } void replacePredecessor(ExplodedNode *node) { Preds.replaceNode(node); } Index: cfe/trunk/lib/StaticAnalyzer/Core/ExplodedGraph.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/ExplodedGraph.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/ExplodedGraph.cpp @@ -283,6 +283,13 @@ return Storage.getAddrOfPtr1() + 1; } +int64_t ExplodedNode::getID(ExplodedGraph *G) const { + Optional 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, Index: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp =================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp @@ -3141,9 +3141,13 @@ } ProgramStateRef state = N->getState(); - Out << "\\|StateID: " << state->getID() << " (" - << (const void*) state.get() << ")" - << " NodeID: " << (const void*) N << "\\|"; + ExplodedGraph &Graph = + static_cast(state->getStateManager().getOwningEngine()) + ->getGraph(); + + Out << "\\|StateID: " << state->getID() << " (" << (const void *)state.get() + << ")" + << " NodeID: " << N->getID(&Graph) << " (" << (const void *)N << ")\\|"; state->printDOT(Out, N->getLocationContext());