summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-02-28 21:49:04 +0000
committerAnna Zaks <ganna@apple.com>2012-02-28 21:49:04 +0000
commitc2994283aa7538b7420c8e398cde7afa328d7042 (patch)
tree3df0da900674de011b99f24081e06e67de26a503 /lib
parent670326f414ca3f8f2cb1ad2f8bd42d5804b563c8 (diff)
downloadclang-c2994283aa7538b7420c8e398cde7afa328d7042.tar.gz
clang-c2994283aa7538b7420c8e398cde7afa328d7042.tar.bz2
clang-c2994283aa7538b7420c8e398cde7afa328d7042.tar.xz
[analyzer] Stats: Add the stats about remove dead bindings, correct the
test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngine.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp
index 77b71decc5..ffc0916ed1 100644
--- a/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -13,6 +13,8 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "ExprEngine"
+
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h"
@@ -27,6 +29,7 @@
#include "clang/Basic/PrettyStackTrace.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/ImmutableList.h"
+#include "llvm/ADT/Statistic.h"
#ifndef NDEBUG
#include "llvm/Support/GraphWriter.h"
@@ -36,6 +39,11 @@ using namespace clang;
using namespace ento;
using llvm::APSInt;
+STATISTIC(NumRemoveDeadBindings,
+ "The # of times RemoveDeadBindings is called");
+STATISTIC(NumRemoveDeadBindingsSkipped,
+ "The # of times RemoveDeadBindings is skipped");
+
//===----------------------------------------------------------------------===//
// Utility functions.
//===----------------------------------------------------------------------===//
@@ -261,6 +269,7 @@ void ExprEngine::ProcessStmt(const CFGStmt S,
SymbolReaper SymReaper(LC, currentStmt, SymMgr, getStoreManager());
if (shouldRemoveDeadBindings(AMgr, S, Pred, LC)) {
+ NumRemoveDeadBindings++;
getCheckerManager().runCheckersForLiveSymbols(CleanedState, SymReaper);
const StackFrameContext *SFC = LC->getCurrentStackFrame();
@@ -269,6 +278,8 @@ void ExprEngine::ProcessStmt(const CFGStmt S,
// and the store. TODO: The function should just return new env and store,
// not a new state.
CleanedState = StateMgr.removeDeadBindings(CleanedState, SFC, SymReaper);
+ } else {
+ NumRemoveDeadBindingsSkipped++;
}
// Process any special transfer function for dead symbols.