Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: src/IceTimerTree.cpp

Issue 1343843003: Refactor all instances of `typedef y x` to the C++11 `using x = y` syntax. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTimerTree.h ('k') | src/IceTypes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTimerTree.cpp - Pass timer defs ---------------------===// 1 //===- subzero/src/IceTimerTree.cpp - Pass timer defs ---------------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 LeafTimes.assign(LeafTimes.size(), 0); 213 LeafTimes.assign(LeafTimes.size(), 0);
214 LeafCounts.assign(LeafCounts.size(), 0); 214 LeafCounts.assign(LeafCounts.size(), 0);
215 for (TimerTreeNode &Node : Nodes) { 215 for (TimerTreeNode &Node : Nodes) {
216 Node.Time = 0; 216 Node.Time = 0;
217 Node.UpdateCount = 0; 217 Node.UpdateCount = 0;
218 } 218 }
219 } 219 }
220 220
221 namespace { 221 namespace {
222 222
223 typedef std::multimap<double, IceString> DumpMapType; 223 using DumpMapType = std::multimap<double, IceString>;
224 224
225 // Dump the Map items in reverse order of their time contribution. 225 // Dump the Map items in reverse order of their time contribution.
226 void dumpHelper(Ostream &Str, const DumpMapType &Map, double TotalTime) { 226 void dumpHelper(Ostream &Str, const DumpMapType &Map, double TotalTime) {
227 if (!BuildDefs::dump()) 227 if (!BuildDefs::dump())
228 return; 228 return;
229 for (auto &I : reverse_range(Map)) { 229 for (auto &I : reverse_range(Map)) {
230 char buf[80]; 230 char buf[80];
231 snprintf(buf, llvm::array_lengthof(buf), " %10.6f (%4.1f%%): ", I.first, 231 snprintf(buf, llvm::array_lengthof(buf), " %10.6f (%4.1f%%): ", I.first,
232 I.first * 100 / TotalTime); 232 I.first * 100 / TotalTime);
233 Str << buf << I.second << "\n"; 233 Str << buf << I.second << "\n";
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 dumpHelper(Str, FlatMap, TotalTime); 303 dumpHelper(Str, FlatMap, TotalTime);
304 Str << "Number of timer updates: " << StateChangeCount << "\n"; 304 Str << "Number of timer updates: " << StateChangeCount << "\n";
305 } 305 }
306 306
307 double TimerStack::timestamp() { 307 double TimerStack::timestamp() {
308 // TODO: Implement in terms of std::chrono for C++11. 308 // TODO: Implement in terms of std::chrono for C++11.
309 return llvm::TimeRecord::getCurrentTime(false).getWallTime(); 309 return llvm::TimeRecord::getCurrentTime(false).getWallTime();
310 } 310 }
311 311
312 } // end of namespace Ice 312 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTimerTree.h ('k') | src/IceTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698