diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2025-01-09 18:33:42 +0100 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2025-01-09 18:33:42 +0100 |
commit | 8ac6a6b81629840d2456e32ec4651440523718dc (patch) | |
tree | a7afdd9eb278b6ad2708fd9b7920e939d04fb162 /llvm/lib/Support/Timer.cpp | |
parent | 553fa204ed5ab4c48bc6080451df24310c00e69c (diff) | |
download | llvm-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.cpp | 2 |
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>(); |