aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/Timer.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2025-01-09 18:33:42 +0100
committerBenjamin Kramer <benny.kra@googlemail.com>2025-01-09 18:33:42 +0100
commit8ac6a6b81629840d2456e32ec4651440523718dc (patch)
treea7afdd9eb278b6ad2708fd9b7920e939d04fb162 /llvm/lib/Support/Timer.cpp
parent553fa204ed5ab4c48bc6080451df24310c00e69c (diff)
downloadllvm-8ac6a6b81629840d2456e32ec4651440523718dc.zip
llvm-8ac6a6b81629840d2456e32ec4651440523718dc.tar.gz
llvm-8ac6a6b81629840d2456e32ec4651440523718dc.tar.bz2
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.
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r--llvm/lib/Support/Timer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index ccd78ad..3f0926a 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/lib/Support/Timer.cpp
@@ -507,11 +507,11 @@ private:
// Order of these members and initialization below is important. For example
// the DefaultTimerGroup uses the TimerLock. Most of these also depend on the
// options above.
+ std::once_flag InitDeferredFlag;
std::unique_ptr<SignpostEmitter> SignpostsPtr;
std::unique_ptr<sys::SmartMutex<true>> TimerLockPtr;
std::unique_ptr<TimerGroup> DefaultTimerGroupPtr;
std::unique_ptr<Name2PairMap> NamedGroupedTimersPtr;
- std::once_flag InitDeferredFlag;
TimerGlobals &initDeferred() {
std::call_once(InitDeferredFlag, [this]() {
SignpostsPtr = std::make_unique<SignpostEmitter>();