Skip to content

Commit cf7e631

Browse files
committed
yet more code review comments
1 parent 7fcbfee commit cf7e631

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

llvm/include/llvm/IR/PassTimingInfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ class TimePassesHandler {
8181
TimePassesHandler();
8282
TimePassesHandler(bool Enabled, bool PerRun = false);
8383

84-
~TimePassesHandler() = default;
85-
8684
/// Prints out timing information and then resets the timers.
8785
void print();
8886

llvm/lib/IR/PassTimingInfo.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,10 @@ class PassTimingInfo {
6262

6363
private:
6464
StringMap<unsigned> PassIDCountMap; ///< Map that counts instances of passes
65-
DenseMap<PassInstanceID, Timer *> TimingData; ///< timers for pass instances
65+
DenseMap<PassInstanceID, std::unique_ptr<Timer>> TimingData; ///< timers for pass instances
6666
TimerGroup *PassTG = nullptr;
6767

6868
public:
69-
PassTimingInfo() = default;
70-
71-
~PassTimingInfo() = default;
72-
7369
/// Initializes the static \p TheTimeInfo member to a non-null value when
7470
/// -time-passes is enabled. Leaves it null otherwise.
7571
///
@@ -127,16 +123,16 @@ Timer *PassTimingInfo::getPassTimer(Pass *P, PassInstanceID Pass) {
127123

128124
init();
129125
sys::SmartScopedLock<true> Lock(*TimingInfoMutex);
130-
Timer *&T = TimingData[Pass];
126+
std::unique_ptr<Timer> &T = TimingData[Pass];
131127

132128
if (!T) {
133129
StringRef PassName = P->getPassName();
134130
StringRef PassArgument;
135131
if (const PassInfo *PI = Pass::lookupPassInfo(P->getPassID()))
136132
PassArgument = PI->getPassArgument();
137-
T = newPassTimer(PassArgument.empty() ? PassName : PassArgument, PassName);
133+
T.reset(newPassTimer(PassArgument.empty() ? PassName : PassArgument, PassName));
138134
}
139-
return T;
135+
return T.get();
140136
}
141137

142138
PassTimingInfo *PassTimingInfo::TheTimeInfo;

0 commit comments

Comments
 (0)