From 84a2b30ba3233af9f06b3b96e054d8293be481f0 Mon Sep 17 00:00:00 2001 From: George Karpenkov Date: Thu, 6 Sep 2018 23:08:07 +0000 Subject: [analyzer] Dump stable identifiers for exploded nodes Differential Revision: https://reviews.llvm.org/D51667 llvm-svn: 341602 --- clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp') 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 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, -- cgit v1.2.3