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
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 7b4932d..879e9f6 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/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 @@
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;