[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 f032ee5..c3a385f 100644 (file)
@@ -96,11 +96,7 @@ static TimerGroup *getDefaultTimerGroup() {
 //===----------------------------------------------------------------------===//
 
 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) {