OLD | NEW |
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 "IceTimerTree.h" | 15 #include "IceTimerTree.h" |
16 | 16 |
17 #include "IceDefs.h" | 17 #include "IceDefs.h" |
| 18 |
| 19 #pragma clang diagnostic push |
| 20 #pragma clang diagnostic ignored "-Wunused-parameter" |
18 #include "llvm/Support/Timer.h" | 21 #include "llvm/Support/Timer.h" |
| 22 #pragma clang diagnostic pop |
19 | 23 |
20 namespace Ice { | 24 namespace Ice { |
21 | 25 |
22 TimerStack::TimerStack(const IceString &Name) | 26 TimerStack::TimerStack(const IceString &Name) |
23 : Name(Name), FirstTimestamp(timestamp()), LastTimestamp(FirstTimestamp) { | 27 : Name(Name), FirstTimestamp(timestamp()), LastTimestamp(FirstTimestamp) { |
24 if (!BuildDefs::dump()) | 28 if (!BuildDefs::dump()) |
25 return; | 29 return; |
26 Nodes.resize(1); // Reserve Nodes[0] for the root node (sentinel). | 30 Nodes.resize(1); // Reserve Nodes[0] for the root node (sentinel). |
27 IDs.resize(TT__num); | 31 IDs.resize(TT__num); |
28 LeafTimes.resize(TT__num); | 32 LeafTimes.resize(TT__num); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 dumpHelper(Str, FlatMap, TotalTime); | 302 dumpHelper(Str, FlatMap, TotalTime); |
299 Str << "Number of timer updates: " << StateChangeCount << "\n"; | 303 Str << "Number of timer updates: " << StateChangeCount << "\n"; |
300 } | 304 } |
301 | 305 |
302 double TimerStack::timestamp() { | 306 double TimerStack::timestamp() { |
303 // TODO: Implement in terms of std::chrono for C++11. | 307 // TODO: Implement in terms of std::chrono for C++11. |
304 return llvm::TimeRecord::getCurrentTime(false).getWallTime(); | 308 return llvm::TimeRecord::getCurrentTime(false).getWallTime(); |
305 } | 309 } |
306 | 310 |
307 } // end of namespace Ice | 311 } // end of namespace Ice |
OLD | NEW |