summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-06-22 22:08:12 +0000
committerAnna Zaks <ganna@apple.com>2012-06-22 22:08:12 +0000
commit7aa3687bb6a5f4b1c04bef68e96ca0ceafb35a44 (patch)
tree5e4bad44001d6836efa06d0145f17787e008c59e /clang/lib
parente4b6d5e1c1a97c303185a6ec4ee9d671d6690f78 (diff)
downloadbcm5719-llvm-7aa3687bb6a5f4b1c04bef68e96ca0ceafb35a44.tar.gz
bcm5719-llvm-7aa3687bb6a5f4b1c04bef68e96ca0ceafb35a44.zip
[analyzer]scan-build: report the total number of steps analyzer performs
This would be useful to investigate performance issues. llvm-svn: 159038
Diffstat (limited to 'clang/lib')
-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 b75765d336e..3cdfb6ce36e 100644
--- a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp
@@ -11,6 +11,7 @@
// which represent a path-sensitive, intra-procedural "exploded graph."
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "CoreEngine"
#include "clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/ObjCMessage.h"
@@ -20,11 +21,15 @@
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/Statistic.h"
#include <vector>
using namespace clang;
using namespace ento;
+STATISTIC(NumNodesWithMoreThanTwoSucc,
+ "The # of nodes with more than 2 successors.");
+
//===----------------------------------------------------------------------===//
// Node auditing.
//===----------------------------------------------------------------------===//
@@ -170,6 +175,8 @@ void ExplodedNode::addPredecessor(ExplodedNode *V, ExplodedGraph &G) {
assert (!V->isSink());
Preds.addNode(V, G);
V->Succs.addNode(this, G);
+ if (V->Succs.size() == 3)
+ NumNodesWithMoreThanTwoSucc++;
#ifndef NDEBUG
if (NodeAuditor) NodeAuditor->AddEdge(V, this);
#endif
OpenPOWER on IntegriCloud