summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-09-07 00:42:32 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-09-07 00:42:32 +0000
commit98bee0229749b9164c70579c34f6258f4fcb639b (patch)
treedc53277eb148728b5802619575b18af985f4c8ff /clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
parent93ce8b24d5392db60a4cf91c269639cc591ad006 (diff)
downloadbcm5719-llvm-98bee0229749b9164c70579c34f6258f4fcb639b.tar.gz
bcm5719-llvm-98bee0229749b9164c70579c34f6258f4fcb639b.zip
[analyzer] Skip printing trivial nodes in exploded graph
A node is considered to be trivial if it only has one successor, one predecessor, and a state equal to the predecessor. Can drastically (> 2x) reduce the size of the generated exploded graph. Differential Revision: https://reviews.llvm.org/D51665 llvm-svn: 341616
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
index 66944c616b9..7d7b88a8118 100644
--- a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -290,6 +290,11 @@ int64_t ExplodedNode::getID(ExplodedGraph *G) const {
return *Out / alignof(ExplodedNode);
}
+bool ExplodedNode::isTrivial() const {
+ return pred_size() == 1 && succ_size() == 1 &&
+ (*pred_begin())->getState()->getID() == getState()->getID();
+}
+
ExplodedNode *ExplodedGraph::getNode(const ProgramPoint &L,
ProgramStateRef State,
bool IsSink,
OpenPOWER on IntegriCloud