diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-28 21:49:04 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-28 21:49:04 +0000 |
commit | b6e2854f6886741626e51eb2f121fc030b6c0b78 (patch) | |
tree | 555c88163ad6c07d67d5ef67499498eb5087850f /clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | |
parent | c22c85c29ceae07306018e5ac25f21dc7732074a (diff) | |
download | bcm5719-llvm-b6e2854f6886741626e51eb2f121fc030b6c0b78.tar.gz bcm5719-llvm-b6e2854f6886741626e51eb2f121fc030b6c0b78.zip |
[analyzer] Stats: Add the stats about remove dead bindings, correct the
test.
llvm-svn: 151656
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngine.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp index 77b71decc52..ffc0916ed1e 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp +++ b/clang/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. |