From 171b780c914bcee77b9db530bced2647ee1e561e Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 30 Mar 2010 17:33:59 +0000 Subject: Teach Clang's -cc1 option -print-stats to print LLVM statistics. llvm-svn: 99894 --- clang/lib/Frontend/CompilerInstance.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') 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; -- cgit v1.2.3