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

Side by Side Diff: src/IceTimerTree.h

Issue 952953002: Subzero: Improve class definition hygiene. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix typo Created 5 years, 10 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.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.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
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
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
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTranslator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698