1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Measure time that IR parsing took as part of the -time-passes measurement.

llvm-svn: 178662
This commit is contained in:
Eli Bendersky 2013-04-03 15:33:45 +00:00
parent 994d3213dc
commit 70bff7a437
2 changed files with 13 additions and 4 deletions

View File

@ -1739,10 +1739,8 @@ bool PassManager::run(Module &M) {
}
//===----------------------------------------------------------------------===//
// TimingInfo Class - This class is used to calculate information about the
// amount of time each pass takes to execute. This only happens with
// -time-passes is enabled on the command line.
//
// TimingInfo implementation
bool llvm::TimePassesIsEnabled = false;
static cl::opt<bool,true>
EnableTiming("time-passes", cl::location(TimePassesIsEnabled),

View File

@ -14,9 +14,18 @@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/system_error.h"
#include "llvm/Support/Timer.h"
using namespace llvm;
namespace llvm {
extern bool TimePassesIsEnabled;
}
static const char *TimeIRParsingGroupName = "LLVM IR Parsing";
static const char *TimeIRParsingName = "Parse IR";
Module *llvm::getLazyIRModule(MemoryBuffer *Buffer, SMDiagnostic &Err,
LLVMContext &Context) {
if (isBitcode((const unsigned char *)Buffer->getBufferStart(),
@ -50,6 +59,8 @@ Module *llvm::getLazyIRFileModule(const std::string &Filename, SMDiagnostic &Err
Module *llvm::ParseIR(MemoryBuffer *Buffer, SMDiagnostic &Err,
LLVMContext &Context) {
NamedRegionTimer T(TimeIRParsingName, TimeIRParsingGroupName,
TimePassesIsEnabled);
if (isBitcode((const unsigned char *)Buffer->getBufferStart(),
(const unsigned char *)Buffer->getBufferEnd())) {
std::string ErrMsg;