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 27
27
#include " llvm/Support/YAMLTraits.h"
28
28
#include " llvm/Support/raw_ostream.h"
29
29
#include < limits>
30
+ #include < optional>
30
31
31
32
#if HAVE_UNISTD_H
32
33
#include < unistd.h>
@@ -500,17 +501,17 @@ class llvm::TimerGlobals {
500
501
// the defaultTimerGroup uses the timerLock. Most of these also depend on the
501
502
// options above.
502
503
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;
505
506
std::unique_ptr<TimerGroup> DefaultTimerGroupPtr;
506
- std::unique_ptr <Name2PairMap> NamedGroupedTimersPtr;
507
+ std::optional <Name2PairMap> NamedGroupedTimersPtr;
507
508
TimerGlobals &initDeferred () {
508
509
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 ();
511
512
DefaultTimerGroupPtr.reset (new TimerGroup (
512
513
" misc" , " Miscellaneous Ungrouped Timers" , *TimerLockPtr));
513
- NamedGroupedTimersPtr = std::make_unique<Name2PairMap> ();
514
+ NamedGroupedTimersPtr. emplace ();
514
515
});
515
516
return *this ;
516
517
}
You can’t perform that action at this time.
0 commit comments