diff options
author | Vedant Kumar <vsk@apple.com> | 2015-12-21 23:41:38 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2015-12-21 23:41:38 +0000 |
commit | 11dc6dc71e9db62b15246b56009814397fc4658f (patch) | |
tree | 4fbf94d47cf8844da547dc26397a153553cd43fa /llvm/lib/Support/Timer.cpp | |
parent | f4b4e08db0482a267a6ffe639b99019027bf610c (diff) | |
download | bcm5719-llvm-11dc6dc71e9db62b15246b56009814397fc4658f.tar.gz bcm5719-llvm-11dc6dc71e9db62b15246b56009814397fc4658f.zip |
[Support] Timer: Use emplace_back() and range-based loops (NFC)
llvm-svn: 256217
Diffstat (limited to 'llvm/lib/Support/Timer.cpp')
-rw-r--r-- | llvm/lib/Support/Timer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index c3a385f471f..f8ab214bfbf 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -272,7 +272,7 @@ void TimerGroup::removeTimer(Timer &T) { // If the timer was started, move its data to TimersToPrint. if (T.Started) - TimersToPrint.push_back(std::make_pair(T.Time, T.Name)); + TimersToPrint.emplace_back(T.Time, T.Name); T.TG = nullptr; @@ -306,8 +306,8 @@ void TimerGroup::PrintQueuedTimers(raw_ostream &OS) { std::sort(TimersToPrint.begin(), TimersToPrint.end()); TimeRecord Total; - for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i) - Total += TimersToPrint[i].first; + for (auto &RecordNamePair : TimersToPrint) + Total += RecordNamePair.first; // Print out timing header. OS << "===" << std::string(73, '-') << "===\n"; @@ -358,7 +358,7 @@ void TimerGroup::print(raw_ostream &OS) { // reset them. for (Timer *T = FirstTimer; T; T = T->Next) { if (!T->Started) continue; - TimersToPrint.push_back(std::make_pair(T->Time, T->Name)); + TimersToPrint.emplace_back(T->Time, T->Name); // Clear out the time. T->Started = 0; |