summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-27 23:59:25 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-27 23:59:25 +0000
commit7f1946408dd5ba7258542b1e1637308d7cd1cd69 (patch)
tree185eacde51196b005d2044c4c0cd5b2efe506f5a /lib/IR
parentbefce904c0bcbd8053ad049ae63329ad25e1aabe (diff)
downloadllvm-7f1946408dd5ba7258542b1e1637308d7cd1cd69.tar.gz
llvm-7f1946408dd5ba7258542b1e1637308d7cd1cd69.tar.bz2
llvm-7f1946408dd5ba7258542b1e1637308d7cd1cd69.tar.xz
Teach the pass manager's execution dump to print the current time before
each line. This is particularly nice for tracking which run of a particular pass over a particular function was slow. This also required making the TimeValue string much more useful. First, there is a standard format for writing out a date and time. Let's use that rather than strings that would have to be parsed. Second, actually output the nanosecond resolution that timevalue claims to have. This is proving useful working on PR19499, so I figured it would be generally useful to commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/LegacyPassManager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/IR/LegacyPassManager.cpp b/lib/IR/LegacyPassManager.cpp
index 1ad04982d4..b6d75b483f 100644
--- a/lib/IR/LegacyPassManager.cpp
+++ b/lib/IR/LegacyPassManager.cpp
@@ -22,6 +22,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
+#include "llvm/Support/TimeValue.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
@@ -1158,7 +1159,8 @@ void PMDataManager::dumpPassInfo(Pass *P, enum PassDebuggingString S1,
StringRef Msg) {
if (PassDebugging < Executions)
return;
- dbgs() << (void*)this << std::string(getDepth()*2+1, ' ');
+ dbgs() << "[" << sys::TimeValue::now().str() << "] " << (void *)this
+ << std::string(getDepth() * 2 + 1, ' ');
switch (S1) {
case EXECUTION_MSG:
dbgs() << "Executing Pass '" << P->getPassName();