| 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 /// \file | 10 /// \file |
| 11 /// \brief Defines the TimerTree class, which tracks flat and cumulative | 11 /// \brief Defines the TimerTree class, which tracks flat and cumulative |
| 12 /// execution time collection of call chains. | 12 /// execution time collection of call chains. |
| 13 /// | 13 /// |
| 14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
| 15 | 15 |
| 16 #include "IceTimerTree.h" | 16 #include "IceTimerTree.h" |
| 17 | 17 |
| 18 #include "IceDefs.h" | 18 #include "IceDefs.h" |
| 19 | 19 |
| 20 #ifdef __clang__ |
| 20 #pragma clang diagnostic push | 21 #pragma clang diagnostic push |
| 21 #pragma clang diagnostic ignored "-Wunused-parameter" | 22 #pragma clang diagnostic ignored "-Wunused-parameter" |
| 23 #endif // __clang__ |
| 24 |
| 22 #include "llvm/Support/Timer.h" | 25 #include "llvm/Support/Timer.h" |
| 26 |
| 27 #ifdef __clang__ |
| 23 #pragma clang diagnostic pop | 28 #pragma clang diagnostic pop |
| 29 #endif // __clang__ |
| 24 | 30 |
| 25 namespace Ice { | 31 namespace Ice { |
| 26 | 32 |
| 27 TimerStack::TimerStack(const IceString &Name) | 33 TimerStack::TimerStack(const IceString &Name) |
| 28 : Name(Name), FirstTimestamp(timestamp()), LastTimestamp(FirstTimestamp) { | 34 : Name(Name), FirstTimestamp(timestamp()), LastTimestamp(FirstTimestamp) { |
| 29 if (!BuildDefs::dump()) | 35 if (!BuildDefs::dump()) |
| 30 return; | 36 return; |
| 31 Nodes.resize(1); // Reserve Nodes[0] for the root node (sentinel). | 37 Nodes.resize(1); // Reserve Nodes[0] for the root node (sentinel). |
| 32 IDs.resize(TT__num); | 38 IDs.resize(TT__num); |
| 33 LeafTimes.resize(TT__num); | 39 LeafTimes.resize(TT__num); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 dumpHelper(Str, FlatMap, TotalTime); | 307 dumpHelper(Str, FlatMap, TotalTime); |
| 302 Str << "Number of timer updates: " << StateChangeCount << "\n"; | 308 Str << "Number of timer updates: " << StateChangeCount << "\n"; |
| 303 } | 309 } |
| 304 | 310 |
| 305 double TimerStack::timestamp() { | 311 double TimerStack::timestamp() { |
| 306 // TODO: Implement in terms of std::chrono for C++11. | 312 // TODO: Implement in terms of std::chrono for C++11. |
| 307 return llvm::TimeRecord::getCurrentTime(false).getWallTime(); | 313 return llvm::TimeRecord::getCurrentTime(false).getWallTime(); |
| 308 } | 314 } |
| 309 | 315 |
| 310 } // end of namespace Ice | 316 } // end of namespace Ice |
| OLD | NEW |