OLD | NEW |
1 //===- subzero/src/IceTimerTree.h - Pass timer defs -------------*- C++ -*-===// | 1 //===- subzero/src/IceTimerTree.h - Pass timer defs -------------*- C++ -*-===// |
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 declares the TimerTree class, which allows flat and | 10 // This file declares the TimerTree class, which allows 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 #ifndef SUBZERO_SRC_ICETIMERTREE_H | 15 #ifndef SUBZERO_SRC_ICETIMERTREE_H |
16 #define SUBZERO_SRC_ICETIMERTREE_H | 16 #define SUBZERO_SRC_ICETIMERTREE_H |
17 | 17 |
18 #include "IceTimerTree.def" | 18 #include "IceTimerTree.def" |
19 | 19 |
20 namespace Ice { | 20 namespace Ice { |
21 | 21 |
22 class TimerStack { | 22 class TimerStack { |
| 23 TimerStack() = delete; |
23 TimerStack &operator=(const TimerStack &) = delete; | 24 TimerStack &operator=(const TimerStack &) = delete; |
24 | 25 |
25 // Timer tree index type. A variable of this type is used to access | 26 // Timer tree index type. A variable of this type is used to access |
26 // an interior, not-necessarily-leaf node of the tree. | 27 // an interior, not-necessarily-leaf node of the tree. |
27 typedef std::vector<class TimerTreeNode>::size_type TTindex; | 28 typedef std::vector<class TimerTreeNode>::size_type TTindex; |
28 // Representation of a path of leaf values leading to a particular | 29 // Representation of a path of leaf values leading to a particular |
29 // node. The representation happens to be in "reverse" order, | 30 // node. The representation happens to be in "reverse" order, |
30 // i.e. from leaf/interior to root, for implementation efficiency. | 31 // i.e. from leaf/interior to root, for implementation efficiency. |
31 typedef llvm::SmallVector<TTindex, 8> PathType; | 32 typedef llvm::SmallVector<TTindex, 8> PathType; |
32 // Representation of a mapping of leaf node indexes from one timer | 33 // Representation of a mapping of leaf node indexes from one timer |
(...skipping 19 matching lines...) Expand all Loading... |
52 size_t UpdateCount; | 53 size_t UpdateCount; |
53 }; | 54 }; |
54 | 55 |
55 public: | 56 public: |
56 enum TimerTag { | 57 enum TimerTag { |
57 #define X(tag) TT_##tag, | 58 #define X(tag) TT_##tag, |
58 TIMERTREE_TABLE | 59 TIMERTREE_TABLE |
59 #undef X | 60 #undef X |
60 TT__num | 61 TT__num |
61 }; | 62 }; |
62 TimerStack(const IceString &Name); | 63 explicit TimerStack(const IceString &Name); |
63 TimerStack(const TimerStack &) = default; | 64 TimerStack(const TimerStack &) = default; |
64 TimerIdT getTimerID(const IceString &Name); | 65 TimerIdT getTimerID(const IceString &Name); |
65 void mergeFrom(const TimerStack &Src); | 66 void mergeFrom(const TimerStack &Src); |
66 void setName(const IceString &NewName) { Name = NewName; } | 67 void setName(const IceString &NewName) { Name = NewName; } |
67 const IceString &getName() const { return Name; } | 68 const IceString &getName() const { return Name; } |
68 void push(TimerIdT ID); | 69 void push(TimerIdT ID); |
69 void pop(TimerIdT ID); | 70 void pop(TimerIdT ID); |
70 void reset(); | 71 void reset(); |
71 void dump(Ostream &Str, bool DumpCumulative); | 72 void dump(Ostream &Str, bool DumpCumulative); |
72 | 73 |
(...skipping 13 matching lines...) Expand all Loading... |
86 std::vector<IceString> IDs; // indexed by TimerIdT | 87 std::vector<IceString> IDs; // indexed by TimerIdT |
87 std::vector<TimerTreeNode> Nodes; // indexed by TTindex | 88 std::vector<TimerTreeNode> Nodes; // indexed by TTindex |
88 std::vector<double> LeafTimes; // indexed by TimerIdT | 89 std::vector<double> LeafTimes; // indexed by TimerIdT |
89 std::vector<size_t> LeafCounts; // indexed by TimerIdT | 90 std::vector<size_t> LeafCounts; // indexed by TimerIdT |
90 TTindex StackTop; | 91 TTindex StackTop; |
91 }; | 92 }; |
92 | 93 |
93 } // end of namespace Ice | 94 } // end of namespace Ice |
94 | 95 |
95 #endif // SUBZERO_SRC_ICETIMERTREE_H | 96 #endif // SUBZERO_SRC_ICETIMERTREE_H |
OLD | NEW |