summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Timer.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-30 05:27:58 +0000
committerChris Lattner <sabre@nondot.org>2010-03-30 05:27:58 +0000
commit83fa78efb19d288d172a5db87bafcb9a34a4f035 (patch)
treef867e0550ffee00abd0b0e30ebdfac8b7aca0c7a /include/llvm/Support/Timer.h
parentecdbff8c74e9c85af08fe9ec9cee4625d36c3c36 (diff)
downloadllvm-83fa78efb19d288d172a5db87bafcb9a34a4f035.tar.gz
llvm-83fa78efb19d288d172a5db87bafcb9a34a4f035.tar.bz2
llvm-83fa78efb19d288d172a5db87bafcb9a34a4f035.tar.xz
finally, maintain a global list of timer groups, allowing us to
implement TimerGroup::printAll, which prints and resets all active timers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Timer.h')
-rw-r--r--include/llvm/Support/Timer.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/Support/Timer.h b/include/llvm/Support/Timer.h
index 1d4b080bb3..c5b921c748 100644
--- a/include/llvm/Support/Timer.h
+++ b/include/llvm/Support/Timer.h
@@ -164,12 +164,12 @@ class TimerGroup {
std::string Name;
Timer *FirstTimer; // First timer in the group.
std::vector<std::pair<TimeRecord, std::string> > TimersToPrint;
+
+ TimerGroup **Prev, *Next; // Doubly linked list of TimerGroup's.
TimerGroup(const TimerGroup &TG); // DO NOT IMPLEMENT
void operator=(const TimerGroup &TG); // DO NOT IMPLEMENT
public:
- explicit TimerGroup(const std::string &name = "")
- : Name(name), FirstTimer(0) {}
-
+ explicit TimerGroup(const std::string &name);
~TimerGroup();
void setName(const std::string &name) { Name = name; }
@@ -177,6 +177,9 @@ public:
/// print - Print any started timers in this group and zero them.
void print(raw_ostream &OS);
+ /// printAll - This static method prints all timers and clears them all out.
+ static void printAll(raw_ostream &OS);
+
private:
friend class Timer;
void addTimer(Timer &T);