Skip to content

Commit 8ac6a6b

Browse files
committed
Reorder fields so InitDeferredFlag is destroyed last
TimerGroup's dtor accesses this field. once_flag has a trivial destructor so it doesn't really matter, but msan checks that it's not accessed after destruction.
1 parent 553fa20 commit 8ac6a6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Support/Timer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,11 @@ class llvm::TimerGlobals {
507507
// Order of these members and initialization below is important. For example
508508
// the DefaultTimerGroup uses the TimerLock. Most of these also depend on the
509509
// options above.
510+
std::once_flag InitDeferredFlag;
510511
std::unique_ptr<SignpostEmitter> SignpostsPtr;
511512
std::unique_ptr<sys::SmartMutex<true>> TimerLockPtr;
512513
std::unique_ptr<TimerGroup> DefaultTimerGroupPtr;
513514
std::unique_ptr<Name2PairMap> NamedGroupedTimersPtr;
514-
std::once_flag InitDeferredFlag;
515515
TimerGlobals &initDeferred() {
516516
std::call_once(InitDeferredFlag, [this]() {
517517
SignpostsPtr = std::make_unique<SignpostEmitter>();

0 commit comments

Comments
 (0)