diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-12-22 01:52:37 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-12-22 01:52:37 +0000 |
commit | ff944a8c481d6c0f1ad2633e4be9bf8b1dd2a09f (patch) | |
tree | 4796ad443954b4f34c3e12ed8ee3b9950b12b39e /Driver/AnalysisConsumer.cpp | |
parent | 1b76b80f7509657e9f5b68ccac50033a6afbb684 (diff) |
Add an option to make 'RemoveDeadBindings' a configurable behavior. This enables
us to measure the effect of this optimization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61319 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/AnalysisConsumer.cpp')
-rw-r--r-- | Driver/AnalysisConsumer.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Driver/AnalysisConsumer.cpp b/Driver/AnalysisConsumer.cpp index 3cffc20ea0..1ada515c10 100644 --- a/Driver/AnalysisConsumer.cpp +++ b/Driver/AnalysisConsumer.cpp @@ -31,6 +31,7 @@ #include "clang/Analysis/LocalCheckers.h" #include "clang/Analysis/PathSensitive/GRTransferFuncs.h" #include "clang/Analysis/PathSensitive/GRExprEngine.h" +#include "llvm/Support/CommandLine.h" #include "llvm/Support/Streams.h" #include "llvm/Support/raw_ostream.h" #include "llvm/System/Path.h" @@ -40,6 +41,13 @@ using namespace clang; static ExplodedNodeImpl::Auditor* CreateUbiViz(); + +// Analyzer options. +static llvm::cl::opt<bool> +PurgeDead("analyzer-purge-dead", + llvm::cl::init(true), + llvm::cl::desc("Remove dead symbols, bindings, and constraints before" + " processing a statement.")); //===----------------------------------------------------------------------===// // Basic type definitions. @@ -85,7 +93,7 @@ namespace { const std::string& fname, const std::string& htmldir, AnalysisStores sm, AnalysisDiagClients dc, - bool visgraphviz, bool visubi, bool trim, bool analyzeAll) + bool visgraphviz, bool visubi, bool trim, bool analyzeAll) : VisGraphviz(visgraphviz), VisUbigraph(visubi), TrimGraph(trim), LOpts(lopts), Diags(diags), Ctx(0), PP(pp), PPF(ppf), @@ -136,12 +144,12 @@ namespace { public: AnalysisManager(AnalysisConsumer& c, Decl* d, Stmt* b) - : D(d), Body(b), TU(0), AScope(ScopeDecl), C(c), DisplayedFunction(false) { + : D(d), Body(b), TU(0), AScope(ScopeDecl), C(c), DisplayedFunction(false){ setManagerCreators(); } AnalysisManager(AnalysisConsumer& c, TranslationUnit* tu) - : D(0), Body(0), TU(tu), AScope(ScopeTU), C(c), DisplayedFunction(false) { + : D(0), Body(0), TU(tu), AScope(ScopeTU), C(c), DisplayedFunction(false) { setManagerCreators(); } @@ -403,6 +411,7 @@ static void ActionGRExprEngine(AnalysisManager& mgr, GRTransferFuncs* tf, if (!L) return; GRExprEngine Eng(*mgr.getCFG(), *mgr.getCodeDecl(), mgr.getContext(), *L, + PurgeDead, mgr.getStoreManagerCreator(), mgr.getConstraintManagerCreator()); |