Skip to content

Commit cc49050

Browse files
committed
.
Created using spr 1.3.5-bogner
1 parent 320ab02 commit cc49050

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

llvm/lib/Support/Timer.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "llvm/Support/YAMLTraits.h"
2828
#include "llvm/Support/raw_ostream.h"
2929
#include <limits>
30+
#include <optional>
3031

3132
#if HAVE_UNISTD_H
3233
#include <unistd.h>
@@ -500,17 +501,17 @@ class llvm::TimerGlobals {
500501
// the defaultTimerGroup uses the timerLock. Most of these also depend on the
501502
// options above.
502503
std::once_flag InitDeferredFlag;
503-
std::unique_ptr<SignpostEmitter> SignpostsPtr;
504-
std::unique_ptr<sys::SmartMutex<true>> TimerLockPtr;
504+
std::optional<SignpostEmitter> SignpostsPtr;
505+
std::optional<sys::SmartMutex<true>> TimerLockPtr;
505506
std::unique_ptr<TimerGroup> DefaultTimerGroupPtr;
506-
std::unique_ptr<Name2PairMap> NamedGroupedTimersPtr;
507+
std::optional<Name2PairMap> NamedGroupedTimersPtr;
507508
TimerGlobals &initDeferred() {
508509
std::call_once(InitDeferredFlag, [this]() {
509-
SignpostsPtr = std::make_unique<SignpostEmitter>();
510-
TimerLockPtr = std::make_unique<sys::SmartMutex<true>>();
510+
SignpostsPtr.emplace();
511+
TimerLockPtr.emplace();
511512
DefaultTimerGroupPtr.reset(new TimerGroup(
512513
"misc", "Miscellaneous Ungrouped Timers", *TimerLockPtr));
513-
NamedGroupedTimersPtr = std::make_unique<Name2PairMap>();
514+
NamedGroupedTimersPtr.emplace();
514515
});
515516
return *this;
516517
}

0 commit comments

Comments
 (0)