#include "llvm/ADT/StringMap.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
//===----------------------------------------------------------------------===//
void Timer::init(StringRef N) {
- assert(TG == 0 && "Timer already initialized");
+ assert(!TG && "Timer already initialized");
Name.assign(N.begin(), N.end());
Started = false;
TG = getDefaultTimerGroup();
}
void Timer::init(StringRef N, TimerGroup &tg) {
- assert(TG == 0 && "Timer already initialized");
+ assert(!TG && "Timer already initialized");
Name.assign(N.begin(), N.end());
Started = false;
TG = &tg;
TimerGroup::~TimerGroup() {
// If the timer group is destroyed before the timers it owns, accumulate and
// print the timing data.
- while (FirstTimer != nullptr)
+ while (FirstTimer)
removeTimer(*FirstTimer);
// Remove the group from the TimerGroupList.
// Print the report when all timers in this group are destroyed if some of
// them were started.
- if (FirstTimer != nullptr || TimersToPrint.empty())
+ if (FirstTimer || TimersToPrint.empty())
return;
raw_ostream *OutStream = CreateInfoOutputFile();