diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-30 17:33:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-30 17:33:59 +0000 |
commit | 171b780c914bcee77b9db530bced2647ee1e561e (patch) | |
tree | f53f10552c95513779f7777224cbbfeba146a9e9 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 83fd0156a933c791ec5b38397fb06a07d8aaa7e9 (diff) | |
download | bcm5719-llvm-171b780c914bcee77b9db530bced2647ee1e561e.tar.gz bcm5719-llvm-171b780c914bcee77b9db530bced2647ee1e561e.zip |
Teach Clang's -cc1 option -print-stats to print LLVM statistics.
llvm-svn: 99894
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 7b4932d787a..879e9f681de 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -29,6 +29,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/ADT/Statistic.h" #include "llvm/Support/Timer.h" #include "llvm/System/Host.h" #include "llvm/System/Path.h" @@ -479,6 +480,9 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { if (getFrontendOpts().ShowTimers) createFrontendTimer(); + if (getFrontendOpts().ShowStats) + llvm::EnableStatistics(); + for (unsigned i = 0, e = getFrontendOpts().Inputs.size(); i != e; ++i) { const std::string &InFile = getFrontendOpts().Inputs[i].second; |