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

Side by Side Diff: src/IceTimerTree.cpp

Issue 619893002: Subzero: Auto-awesome iterators. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Use AsmCodeByte instead of uint8_t Created 6 years, 2 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/IceTargetLoweringX8632.cpp ('k') | src/IceTranslator.cpp » ('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 // This file defines the TimerTree class, which tracks flat and 10 // This file defines the TimerTree class, which tracks flat and
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 Prefix = Next; 94 Prefix = Next;
95 } 95 }
96 } 96 }
97 97
98 namespace { 98 namespace {
99 99
100 typedef std::multimap<double, IceString> DumpMapType; 100 typedef std::multimap<double, IceString> DumpMapType;
101 101
102 // Dump the Map items in reverse order of their time contribution. 102 // Dump the Map items in reverse order of their time contribution.
103 void dumpHelper(Ostream &Str, const DumpMapType &Map, double TotalTime) { 103 void dumpHelper(Ostream &Str, const DumpMapType &Map, double TotalTime) {
104 for (DumpMapType::const_reverse_iterator I = Map.rbegin(), E = Map.rend(); 104 // TODO(stichnot): Use llvm::make_range with LLVM 3.5.
105 I != E; ++I) { 105 for (auto I = Map.rbegin(), E = Map.rend(); I != E; ++I) {
106 char buf[80]; 106 char buf[80];
107 snprintf(buf, llvm::array_lengthof(buf), " %10.6f (%4.1f%%): ", I->first, 107 snprintf(buf, llvm::array_lengthof(buf), " %10.6f (%4.1f%%): ", I->first,
108 I->first * 100 / TotalTime); 108 I->first * 100 / TotalTime);
109 Str << buf << I->second << "\n"; 109 Str << buf << I->second << "\n";
110 } 110 }
111 } 111 }
112 112
113 } // end of anonymous namespace 113 } // end of anonymous namespace
114 114
115 void TimerStack::dump(Ostream &Str) { 115 void TimerStack::dump(Ostream &Str) {
(...skipping 24 matching lines...) Expand all
140 dumpHelper(Str, FlatMap, TotalTime); 140 dumpHelper(Str, FlatMap, TotalTime);
141 Str << "Number of timer updates: " << StateChangeCount << "\n"; 141 Str << "Number of timer updates: " << StateChangeCount << "\n";
142 } 142 }
143 143
144 double TimerStack::timestamp() { 144 double TimerStack::timestamp() {
145 // TODO: Implement in terms of std::chrono for C++11. 145 // TODO: Implement in terms of std::chrono for C++11.
146 return llvm::TimeRecord::getCurrentTime(false).getWallTime(); 146 return llvm::TimeRecord::getCurrentTime(false).getWallTime();
147 } 147 }
148 148
149 } // end of namespace Ice 149 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698