diff options
author | Devang Patel <dpatel@apple.com> | 2007-01-29 23:10:37 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-01-29 23:10:37 +0000 |
commit | c874eb54ecf57f493c49934a327e0e4e49f0ff10 (patch) | |
tree | df3467590295daddaa0a256b0e50310c1dc869da /include | |
parent | bcc5f36765e8111c13873a0c0dc874c92385d808 (diff) | |
download | external_llvm-c874eb54ecf57f493c49934a327e0e4e49f0ff10.zip external_llvm-c874eb54ecf57f493c49934a327e0e4e49f0ff10.tar.gz external_llvm-c874eb54ecf57f493c49934a327e0e4e49f0ff10.tar.bz2 |
- Undo previous check-in (i.e. Do not export TimingInfo class through
PassManagers.h).
- Add StopPassTimer() and StartPassTimer() to expose TimingInfo to
CallGraphPassManager
- Use these two APIs in CalLgraphPassManager to measure timings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33638 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/PassManagers.h | 51 |
1 files changed, 2 insertions, 49 deletions
diff --git a/include/llvm/PassManagers.h b/include/llvm/PassManagers.h index e4ae30a..920707c 100644 --- a/include/llvm/PassManagers.h +++ b/include/llvm/PassManagers.h @@ -12,7 +12,6 @@ //===----------------------------------------------------------------------===// #include "llvm/PassManager.h" -#include "llvm/Support/Timer.h" using namespace llvm; class llvm::PMDataManager; @@ -324,53 +323,7 @@ public: } }; -//===----------------------------------------------------------------------===// -// TimingInfo Class - This class is used to calculate information about the -// amount of time each pass takes to execute. This only happens when -// -time-passes is enabled on the command line. -// - -class TimingInfo { - std::map<Pass*, Timer> TimingData; - TimerGroup TG; - -public: - // Use 'create' member to get this. - TimingInfo() : TG("... Pass execution timing report ...") {} - - // TimingDtor - Print out information about timing information - ~TimingInfo() { - // Delete all of the timers... - TimingData.clear(); - // TimerGroup is deleted next, printing the report. - } - - // createTheTimeInfo - This method either initializes the TheTimeInfo pointer - // to a non null value (if the -time-passes option is enabled) or it leaves it - // null. It may be called multiple times. - static void createTheTimeInfo(); - - void passStarted(Pass *P) { - - if (dynamic_cast<PMDataManager *>(P)) - return; - - std::map<Pass*, Timer>::iterator I = TimingData.find(P); - if (I == TimingData.end()) - I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), TG))).first; - I->second.startTimer(); - } - void passEnded(Pass *P) { - - if (dynamic_cast<PMDataManager *>(P)) - return; - - std::map<Pass*, Timer>::iterator I = TimingData.find(P); - assert (I != TimingData.end() && "passStarted/passEnded not nested right!"); - I->second.stopTimer(); - } -}; - -extern TimingInfo *getTheTimeInfo(); } +extern void StartPassTimer(Pass *); +extern void StopPassTimer(Pass *); |