[Support] Timer: simplify the init() method
authorVedant Kumar <vsk@apple.com>
Mon, 21 Dec 2015 23:27:44 +0000 (23:27 +0000)
committerVedant Kumar <vsk@apple.com>
Mon, 21 Dec 2015 23:27:44 +0000 (23:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256215 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Timer.cpp

index f032ee5d30d04ef06f8b510574eee17daeddc4cc..c3a385f471f9d12953d383648d3049c98e99479c 100644 (file)
@@ -96,11 +96,7 @@ static TimerGroup *getDefaultTimerGroup() {
 //===----------------------------------------------------------------------===//
 
 void Timer::init(StringRef N) {
 //===----------------------------------------------------------------------===//
 
 void Timer::init(StringRef N) {
-  assert(!TG && "Timer already initialized");
-  Name.assign(N.begin(), N.end());
-  Started = false;
-  TG = getDefaultTimerGroup();
-  TG->addTimer(*this);
+  init(N, *getDefaultTimerGroup());
 }
 
 void Timer::init(StringRef N, TimerGroup &tg) {
 }
 
 void Timer::init(StringRef N, TimerGroup &tg) {