llvm.org GIT mirror llvm / 7226592
[Support] Timer: Use emplace_back() and range-based loops (NFC) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256217 91177308-0d34-0410-b5e6-96231b3b80d8 Vedant Kumar 3 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
271271
272272 // If the timer was started, move its data to TimersToPrint.
273273 if (T.Started)
274 TimersToPrint.push_back(std::make_pair(T.Time, T.Name));
274 TimersToPrint.emplace_back(T.Time, T.Name);
275275
276276 T.TG = nullptr;
277277
305305 std::sort(TimersToPrint.begin(), TimersToPrint.end());
306306
307307 TimeRecord Total;
308 for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
309 Total += TimersToPrint[i].first;
308 for (auto &RecordNamePair : TimersToPrint)
309 Total += RecordNamePair.first;
310310
311311 // Print out timing header.
312312 OS << "===" << std::string(73, '-') << "===\n";
357357 // reset them.
358358 for (Timer *T = FirstTimer; T; T = T->Next) {
359359 if (!T->Started) continue;
360 TimersToPrint.push_back(std::make_pair(T->Time, T->Name));
360 TimersToPrint.emplace_back(T->Time, T->Name);
361361
362362 // Clear out the time.
363363 T->Started = 0;