diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-30 05:20:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-30 05:20:02 +0000 |
commit | ecdbff8c74e9c85af08fe9ec9cee4625d36c3c36 (patch) | |
tree | 2ac67c18c24737fea78b2c52f97a7f3f5fe9b9c7 /include/llvm/Support/Timer.h | |
parent | 49a2bb23d1391c8be45985518d4c5e99ff11b864 (diff) |
add a new TimerGroup::print method, and refactor away the bogus
TimerGroup copy ctor and assignment operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99875 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Timer.h')
-rw-r--r-- | include/llvm/Support/Timer.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/include/llvm/Support/Timer.h b/include/llvm/Support/Timer.h index 2997a8744c..1d4b080bb3 100644 --- a/include/llvm/Support/Timer.h +++ b/include/llvm/Support/Timer.h @@ -164,30 +164,24 @@ class TimerGroup { std::string Name; Timer *FirstTimer; // First timer in the group. std::vector<std::pair<TimeRecord, std::string> > TimersToPrint; + 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() : FirstTimer(0) {} + explicit TimerGroup(const std::string &name = "") + : Name(name), FirstTimer(0) {} - explicit TimerGroup(const TimerGroup &TG) : FirstTimer(0) { - operator=(TG); - } ~TimerGroup(); - void operator=(const TimerGroup &TG) { - assert(TG.FirstTimer == 0 && FirstTimer == 0 && - "Cannot assign group with timers"); - Name = TG.Name; - } - - void setName(const std::string &name) { Name = name; } - - void PrintQueuedTimers(raw_ostream &OS); + + /// print - Print any started timers in this group and zero them. + void print(raw_ostream &OS); private: friend class Timer; void addTimer(Timer &T); void removeTimer(Timer &T); + void PrintQueuedTimers(raw_ostream &OS); }; } // End llvm namespace |