File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 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 }
You can’t perform that action at this time.
0 commit comments