summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-09-06 23:08:07 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-09-06 23:08:07 +0000
commit84a2b30ba3233af9f06b3b96e054d8293be481f0 (patch)
tree8c954cd1280c6ebce9f19ccd7f1f898d55b82126 /clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
parent95363e378aab20a8093bd22cf8c1a884a8ead039 (diff)
downloadbcm5719-llvm-84a2b30ba3233af9f06b3b96e054d8293be481f0.tar.gz
bcm5719-llvm-84a2b30ba3233af9f06b3b96e054d8293be481f0.zip
[analyzer] Dump stable identifiers for exploded nodes
Differential Revision: https://reviews.llvm.org/D51667 llvm-svn: 341602
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp7
1 files changed, 7 insertions, 0 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,
OpenPOWER on IntegriCloud