diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-27 21:33:16 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-27 21:33:16 +0000 |
commit | b02865403112ce582af2a73ef4f142bffe8ea012 (patch) | |
tree | 0b275087e055a9b1db29dfe747b49e76965644d4 /clang/lib | |
parent | 84e6e5cd1a68c28ff0b118f02738d476ba63d357 (diff) | |
download | bcm5719-llvm-b02865403112ce582af2a73ef4f142bffe8ea012.tar.gz bcm5719-llvm-b02865403112ce582af2a73ef4f142bffe8ea012.zip |
[analyzer] Add -analyzer-stats, which hooks up LLVM stats tracking.
As in http://llvm.org/docs/ProgrammersManual.html#Statistic
llvm-svn: 151570
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 1 | ||||
-rw-r--r-- | clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 862a6547f82..c46c52c7bdd 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1043,6 +1043,7 @@ static bool ParseAnalyzerArgs(AnalyzerOptions &Opts, ArgList &Args, Opts.MaxLoop = Args.getLastArgIntValue(OPT_analyzer_max_loop, 4, Diags); Opts.EagerlyTrimEGraph = !Args.hasArg(OPT_analyzer_no_eagerly_trim_egraph); Opts.InlineCall = Args.hasArg(OPT_analyzer_inline_call); + Opts.PrintStats = Args.hasArg(OPT_analyzer_stats); Opts.CheckersControlList.clear(); for (arg_iterator it = Args.filtered_begin(OPT_analyzer_checker, diff --git a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index 93c879ee96a..074ad23ce46 100644 --- a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -35,6 +35,7 @@ #include "llvm/Support/Path.h" #include "llvm/Support/Program.h" #include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/Statistic.h" using namespace clang; using namespace ento; @@ -157,6 +158,8 @@ public: Opts.UnoptimizedCFG, Opts.CFGAddImplicitDtors, Opts.CFGAddInitializers, Opts.EagerlyTrimEGraph)); + if (Opts.PrintStats) + llvm::EnableStatistics(); } virtual void HandleTranslationUnit(ASTContext &C); |