aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support
diff options
context:
space:
mode:
authorEli Bendersky <eliben@google.com>2013-03-20 17:00:25 +0000
committerEli Bendersky <eliben@google.com>2013-03-20 17:00:25 +0000
commit0f9b8503dece38059743e3adc6083ea493b73744 (patch)
tree564a88d36b5161fafaf2bc4ed84f982045fd4f7c /lib/Support
parent279ad470b679be919ca220e2b664d9cf94055bc5 (diff)
downloadexternal_llvm-0f9b8503dece38059743e3adc6083ea493b73744.zip
external_llvm-0f9b8503dece38059743e3adc6083ea493b73744.tar.gz
external_llvm-0f9b8503dece38059743e3adc6083ea493b73744.tar.bz2
Add timing of the IR parsing code with a new -time-ir-parsing flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r--lib/Support/CMakeLists.txt1
-rw-r--r--lib/Support/IRReader.cpp21
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt
index 5ba69fc..f661249 100644
--- a/lib/Support/CMakeLists.txt
+++ b/lib/Support/CMakeLists.txt
@@ -27,6 +27,7 @@ add_llvm_library(LLVMSupport
IntEqClasses.cpp
IntervalMap.cpp
IntrusiveRefCntPtr.cpp
+ IRReader.cpp
IsInf.cpp
IsNAN.cpp
Locale.cpp
diff --git a/lib/Support/IRReader.cpp b/lib/Support/IRReader.cpp
new file mode 100644
index 0000000..1dc56dd
--- /dev/null
+++ b/lib/Support/IRReader.cpp
@@ -0,0 +1,21 @@
+//===- IRReader.cpp - Reader for LLVM IR files ----------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/IRReader.h"
+using namespace llvm;
+
+const char *llvm::TimeIRParsingGroupName = "LLVM IR Parsing";
+const char *llvm::TimeIRParsingName = "Parse IR";
+
+bool llvm::TimeIRParsingIsEnabled = false;
+static cl::opt<bool,true>
+EnableTimeIRParsing("time-ir-parsing", cl::location(TimeIRParsingIsEnabled),
+ cl::desc("Measure the time IR parsing takes"));
+