Skip to content

Commit f270d40

Browse files
committed
remove defined-once member functions that are only used once
Created using spr 1.3.5-bogner
1 parent 366d63f commit f270d40

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

llvm/lib/Support/Timer.cpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -495,27 +495,17 @@ class llvm::TimerGlobals {
495495
TimerLock};
496496
SignpostEmitter Signposts;
497497

498-
private:
499498
// Order of these members and initialization below is important. For example
500499
// the defaultTimerGroup uses the timerLock. Most of these also depend on the
501500
// options above.
502501
std::once_flag InitDeferredFlag;
503502
std::optional<Name2PairMap> NamedGroupedTimersPtr;
503+
504504
TimerGlobals &initDeferred() {
505505
std::call_once(InitDeferredFlag,
506506
[this]() { NamedGroupedTimersPtr.emplace(); });
507507
return *this;
508508
}
509-
510-
public:
511-
SignpostEmitter &signposts() { return Signposts; }
512-
sys::SmartMutex<true> &timerLock() { return TimerLock; }
513-
TimerGroup &defaultTimerGroup() { return DefaultTimerGroup; }
514-
Name2PairMap &namedGroupedTimers() {
515-
return *initDeferred().NamedGroupedTimersPtr;
516-
}
517-
518-
public:
519509
TimerGlobals()
520510
: InfoOutputFilename(
521511
"info-output-file", cl::value_desc("filename"),
@@ -540,15 +530,15 @@ static std::string &libSupportInfoOutputFilename() {
540530
}
541531
static bool trackSpace() { return ManagedTimerGlobals->TrackSpace; }
542532
static bool sortTimers() { return ManagedTimerGlobals->SortTimers; }
543-
static SignpostEmitter &signposts() { return ManagedTimerGlobals->signposts(); }
533+
static SignpostEmitter &signposts() { return ManagedTimerGlobals->Signposts; }
544534
static sys::SmartMutex<true> &timerLock() {
545-
return ManagedTimerGlobals->timerLock();
535+
return ManagedTimerGlobals->TimerLock;
546536
}
547537
static TimerGroup &defaultTimerGroup() {
548-
return ManagedTimerGlobals->defaultTimerGroup();
538+
return ManagedTimerGlobals->DefaultTimerGroup;
549539
}
550540
static Name2PairMap &namedGroupedTimers() {
551-
return ManagedTimerGlobals->namedGroupedTimers();
541+
return *ManagedTimerGlobals->initDeferred().NamedGroupedTimersPtr;
552542
}
553543

554544
void llvm::initTimerOptions() { *ManagedTimerGlobals; }

0 commit comments

Comments
 (0)