Skip to content

Commit 5d2ad37

Browse files
committed
.
Created using spr 1.3.5-bogner
1 parent f270d40 commit 5d2ad37

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

llvm/lib/Support/Timer.cpp

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,6 @@ const char *TimerGroup::printAllJSONValues(raw_ostream &OS, const char *delim) {
461461
return delim;
462462
}
463463

464-
void TimerGroup::constructForStatistics() {
465-
libSupportInfoOutputFilename();
466-
namedGroupedTimers();
467-
}
468-
469464
//===----------------------------------------------------------------------===//
470465
// Timer Globals
471466
//
@@ -487,9 +482,20 @@ void TimerGroup::constructForStatistics() {
487482
class llvm::TimerGlobals {
488483
public:
489484
std::string LibSupportInfoOutputFilename;
490-
cl::opt<std::string, true> InfoOutputFilename;
491-
cl::opt<bool> TrackSpace;
492-
cl::opt<bool> SortTimers;
485+
cl::opt<std::string, true> InfoOutputFilename{
486+
"info-output-file", cl::value_desc("filename"),
487+
cl::desc("File to append -stats and -timer output to"), cl::Hidden,
488+
cl::location(LibSupportInfoOutputFilename)};
489+
cl::opt<bool> TrackSpace{
490+
"track-memory",
491+
cl::desc("Enable -time-passes memory tracking (this may be slow)"),
492+
cl::Hidden};
493+
cl::opt<bool> SortTimers{
494+
"sort-timers",
495+
cl::desc("In the report, sort the timers in each group in wall clock"
496+
" time order"),
497+
cl::init(true), cl::Hidden};
498+
493499
sys::SmartMutex<true> TimerLock;
494500
TimerGroup DefaultTimerGroup{"misc", "Miscellaneous Ungrouped Timers",
495501
TimerLock};
@@ -506,21 +512,6 @@ class llvm::TimerGlobals {
506512
[this]() { NamedGroupedTimersPtr.emplace(); });
507513
return *this;
508514
}
509-
TimerGlobals()
510-
: InfoOutputFilename(
511-
"info-output-file", cl::value_desc("filename"),
512-
cl::desc("File to append -stats and -timer output to"), cl::Hidden,
513-
cl::location(LibSupportInfoOutputFilename)),
514-
TrackSpace(
515-
"track-memory",
516-
cl::desc("Enable -time-passes memory tracking (this may be slow)"),
517-
cl::Hidden),
518-
SortTimers(
519-
"sort-timers",
520-
cl::desc(
521-
"In the report, sort the timers in each group in wall clock"
522-
" time order"),
523-
cl::init(true), cl::Hidden) {}
524515
};
525516

526517
static ManagedStatic<TimerGlobals> ManagedTimerGlobals;
@@ -542,5 +533,8 @@ static Name2PairMap &namedGroupedTimers() {
542533
}
543534

544535
void llvm::initTimerOptions() { *ManagedTimerGlobals; }
536+
void TimerGroup::constructForStatistics() {
537+
ManagedTimerGlobals->initDeferred();
538+
}
545539

546540
void *TimerGroup::acquireTimerGlobals() { return ManagedTimerGlobals.claim(); }

0 commit comments

Comments
 (0)