aboutsummaryrefslogtreecommitdiff
path: root/tools/driver/cc1_main.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-30 17:33:59 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-30 17:33:59 +0000
commit95dd5583e3900443a1d7970d557d8c54aa320601 (patch)
tree692370ec611d105625cb051816659e378bf0661d /tools/driver/cc1_main.cpp
parentee11b2dd530f3fb873e108f21341626168758a45 (diff)
Teach Clang's -cc1 option -print-stats to print LLVM statistics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/cc1_main.cpp')
-rw-r--r--tools/driver/cc1_main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp
index 5770a1a115..35854bea05 100644
--- a/tools/driver/cc1_main.cpp
+++ b/tools/driver/cc1_main.cpp
@@ -29,6 +29,7 @@
#include "clang/Frontend/TextDiagnosticPrinter.h"
#include "llvm/LLVMContext.h"
#include "llvm/ADT/OwningPtr.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Timer.h"
@@ -279,6 +280,8 @@ int cc1_main(const char **ArgBegin, const char **ArgEnd,
// When running with -disable-free, don't do any destruction or shutdown.
if (Clang->getFrontendOpts().DisableFree) {
+ if (Clang->getFrontendOpts().ShowStats)
+ llvm::PrintStatistics();
Clang.take();
return !Success;
}