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

Side by Side Diff: src/IceTimerTree.cpp

Issue 623493002: Subzero: Allow builds with assertions disabled. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove commented-out include 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/IceTimerTree.h ('k') | src/assembler_ia32.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 // This file defines the TimerTree class, which tracks flat and 10 // This file defines the TimerTree class, which tracks flat and
11 // cumulative execution time collection of call chains. 11 // cumulative execution time collection of call chains.
12 // 12 //
13 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
14 14
15 #include "llvm/Support/Timer.h"
16
15 #include "IceDefs.h" 17 #include "IceDefs.h"
16 #include "IceTimerTree.h" 18 #include "IceTimerTree.h"
17 19
18 namespace Ice { 20 namespace Ice {
19 21
20 std::vector<IceString> TimerStack::IDs; 22 std::vector<IceString> TimerStack::IDs;
21 23
22 TimerStack::TimerStack(const IceString &TopLevelName) 24 TimerStack::TimerStack(const IceString &TopLevelName)
23 : FirstTimestamp(timestamp()), LastTimestamp(FirstTimestamp), 25 : FirstTimestamp(timestamp()), LastTimestamp(FirstTimestamp),
24 StateChangeCount(0), StackTop(0) { 26 StateChangeCount(0), StackTop(0) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 dumpHelper(Str, CumulativeMap, TotalTime); 134 dumpHelper(Str, CumulativeMap, TotalTime);
133 Str << "Flat function times:\n"; 135 Str << "Flat function times:\n";
134 DumpMapType FlatMap; 136 DumpMapType FlatMap;
135 for (TimerIdT i = 0; i < LeafTimes.size(); ++i) { 137 for (TimerIdT i = 0; i < LeafTimes.size(); ++i) {
136 FlatMap.insert(std::make_pair(LeafTimes[i], IDs[i])); 138 FlatMap.insert(std::make_pair(LeafTimes[i], IDs[i]));
137 } 139 }
138 dumpHelper(Str, FlatMap, TotalTime); 140 dumpHelper(Str, FlatMap, TotalTime);
139 Str << "Number of timer updates: " << StateChangeCount << "\n"; 141 Str << "Number of timer updates: " << StateChangeCount << "\n";
140 } 142 }
141 143
144 double TimerStack::timestamp() {
145 // TODO: Implement in terms of std::chrono for C++11.
146 return llvm::TimeRecord::getCurrentTime(false).getWallTime();
147 }
148
142 } // end of namespace Ice 149 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTimerTree.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698