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

Side by Side Diff: src/IceGlobalContext.h

Issue 656123003: Subzero: Class definition cleanup. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Changes for Karl 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/IceConverter.h ('k') | src/IceInst.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/IceGlobalContext.h - Global context defs -----*- C++ -*-===// 1 //===- subzero/src/IceGlobalContext.h - Global context 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 aspects of the compilation that persist across 10 // This file declares aspects of the compilation that persist across
(...skipping 16 matching lines...) Expand all
27 #include "IceTimerTree.h" 27 #include "IceTimerTree.h"
28 #include "IceTypes.h" 28 #include "IceTypes.h"
29 29
30 namespace Ice { 30 namespace Ice {
31 31
32 class ClFlags; 32 class ClFlags;
33 class FuncSigType; 33 class FuncSigType;
34 34
35 // This class collects rudimentary statistics during translation. 35 // This class collects rudimentary statistics during translation.
36 class CodeStats { 36 class CodeStats {
37 CodeStats(const CodeStats &) = delete;
38 // CodeStats &operator=(const CodeStats &) = delete;
39
37 public: 40 public:
38 CodeStats() 41 CodeStats()
39 : InstructionsEmitted(0), RegistersSaved(0), FrameBytes(0), Spills(0), 42 : InstructionsEmitted(0), RegistersSaved(0), FrameBytes(0), Spills(0),
40 Fills(0) {} 43 Fills(0) {}
41 void reset() { *this = CodeStats(); } 44 void reset() { *this = CodeStats(); }
42 void updateEmitted(uint32_t InstCount) { InstructionsEmitted += InstCount; } 45 void updateEmitted(uint32_t InstCount) { InstructionsEmitted += InstCount; }
43 void updateRegistersSaved(uint32_t Num) { RegistersSaved += Num; } 46 void updateRegistersSaved(uint32_t Num) { RegistersSaved += Num; }
44 void updateFrameBytes(uint32_t Bytes) { FrameBytes += Bytes; } 47 void updateFrameBytes(uint32_t Bytes) { FrameBytes += Bytes; }
45 void updateSpills() { ++Spills; } 48 void updateSpills() { ++Spills; }
46 void updateFills() { ++Fills; } 49 void updateFills() { ++Fills; }
(...skipping 11 matching lines...) Expand all
58 uint32_t RegistersSaved; 61 uint32_t RegistersSaved;
59 uint32_t FrameBytes; 62 uint32_t FrameBytes;
60 uint32_t Spills; 63 uint32_t Spills;
61 uint32_t Fills; 64 uint32_t Fills;
62 }; 65 };
63 66
64 // TODO: Accesses to all non-const fields of GlobalContext need to 67 // TODO: Accesses to all non-const fields of GlobalContext need to
65 // be synchronized, especially the constant pool, the allocator, and 68 // be synchronized, especially the constant pool, the allocator, and
66 // the output streams. 69 // the output streams.
67 class GlobalContext { 70 class GlobalContext {
71 GlobalContext(const GlobalContext &) = delete;
72 GlobalContext &operator=(const GlobalContext &) = delete;
73
68 public: 74 public:
69 GlobalContext(llvm::raw_ostream *OsDump, llvm::raw_ostream *OsEmit, 75 GlobalContext(llvm::raw_ostream *OsDump, llvm::raw_ostream *OsEmit,
70 VerboseMask Mask, TargetArch Arch, OptLevel Opt, 76 VerboseMask Mask, TargetArch Arch, OptLevel Opt,
71 IceString TestPrefix, const ClFlags &Flags); 77 IceString TestPrefix, const ClFlags &Flags);
72 ~GlobalContext(); 78 ~GlobalContext();
73 79
74 // Returns true if any of the specified options in the verbose mask 80 // Returns true if any of the specified options in the verbose mask
75 // are set. If the argument is omitted, it checks if any verbose 81 // are set. If the argument is omitted, it checks if any verbose
76 // options at all are set. 82 // options at all are set.
77 VerboseMask getVerbose() const { return VMask; } 83 VerboseMask getVerbose() const { return VMask; }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 const TargetArch Arch; 200 const TargetArch Arch;
195 const OptLevel Opt; 201 const OptLevel Opt;
196 const IceString TestPrefix; 202 const IceString TestPrefix;
197 const ClFlags &Flags; 203 const ClFlags &Flags;
198 bool HasEmittedFirstMethod; 204 bool HasEmittedFirstMethod;
199 RandomNumberGenerator RNG; 205 RandomNumberGenerator RNG;
200 CodeStats StatsFunction; 206 CodeStats StatsFunction;
201 CodeStats StatsCumulative; 207 CodeStats StatsCumulative;
202 std::vector<TimerStack> Timers; 208 std::vector<TimerStack> Timers;
203 std::vector<GlobalDeclaration *> GlobalDeclarations; 209 std::vector<GlobalDeclaration *> GlobalDeclarations;
204 GlobalContext(const GlobalContext &) = delete;
205 GlobalContext &operator=(const GlobalContext &) = delete;
206 210
207 // Private helpers for mangleName() 211 // Private helpers for mangleName()
208 typedef llvm::SmallVector<char, 32> ManglerVector; 212 typedef llvm::SmallVector<char, 32> ManglerVector;
209 void incrementSubstitutions(ManglerVector &OldName) const; 213 void incrementSubstitutions(ManglerVector &OldName) const;
210 }; 214 };
211 215
212 // Helper class to push and pop a timer marker. The constructor 216 // Helper class to push and pop a timer marker. The constructor
213 // pushes a marker, and the destructor pops it. This is for 217 // pushes a marker, and the destructor pops it. This is for
214 // convenient timing of regions of code. 218 // convenient timing of regions of code.
215 class TimerMarker { 219 class TimerMarker {
(...skipping 15 matching lines...) Expand all
231 235
232 private: 236 private:
233 TimerIdT ID; 237 TimerIdT ID;
234 GlobalContext *const Ctx; 238 GlobalContext *const Ctx;
235 const bool Active; 239 const bool Active;
236 }; 240 };
237 241
238 } // end of namespace Ice 242 } // end of namespace Ice
239 243
240 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H 244 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H
OLDNEW
« no previous file with comments | « src/IceConverter.h ('k') | src/IceInst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698