aboutsummaryrefslogtreecommitdiff
path: root/Driver/clang.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-18 01:12:43 +0000
committerChris Lattner <sabre@nondot.org>2009-02-18 01:12:43 +0000
commitb2509e148cc7218c46ec46b7654eeab0eb52eb28 (patch)
treee79b8818708867912c3e4025e81b8bcfe061b5e0 /Driver/clang.cpp
parente1d77c32c13b3f42886406975bbda83cae770cba (diff)
wire up a minimal -ftime-report, which prints the optimizer/codegen
times. Daniel, plz add driver support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64869 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/clang.cpp')
-rw-r--r--Driver/clang.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 24c4d7fe09..a22e0d2b90 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -42,6 +42,7 @@
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
+#include "llvm/Pass.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringExtras.h"
@@ -211,6 +212,12 @@ InheritanceViewCls("cxx-inheritance-view",
//===----------------------------------------------------------------------===//
// Builtin Options
//===----------------------------------------------------------------------===//
+
+static llvm::cl::opt<bool>
+TimeReport("ftime-report",
+ llvm::cl::desc("Print the amount of time each "
+ "phase of compilation takes"));
+
static llvm::cl::opt<bool>
Freestanding("ffreestanding",
llvm::cl::desc("Assert that the compilation takes place in a "
@@ -1503,6 +1510,10 @@ int main(int argc, char **argv) {
// If no input was specified, read from stdin.
if (InputFilenames.empty())
InputFilenames.push_back("-");
+
+ // Handle -ftime-report.
+ if (TimeReport)
+ llvm::TimePassesIsEnabled = true;
// Create a file manager object to provide access to and cache the filesystem.
FileManager FileMgr;