| OLD | NEW |
| 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 /// \file | 10 /// \file |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 CodeStats() { reset(); } | 92 CodeStats() { reset(); } |
| 93 void reset() { Stats.fill(0); } | 93 void reset() { Stats.fill(0); } |
| 94 void update(CSTag Tag, uint32_t Count = 1) { | 94 void update(CSTag Tag, uint32_t Count = 1) { |
| 95 assert(Tag < Stats.size()); | 95 assert(Tag < Stats.size()); |
| 96 Stats[Tag] += Count; | 96 Stats[Tag] += Count; |
| 97 } | 97 } |
| 98 void add(const CodeStats &Other) { | 98 void add(const CodeStats &Other) { |
| 99 for (uint32_t i = 0; i < Stats.size(); ++i) | 99 for (uint32_t i = 0; i < Stats.size(); ++i) |
| 100 Stats[i] += Other.Stats[i]; | 100 Stats[i] += Other.Stats[i]; |
| 101 } | 101 } |
| 102 void dump(const IceString &Name, Ostream &Str); | 102 void dump(const IceString &Name, GlobalContext *Ctx); |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 std::array<uint32_t, CS_NUM> Stats; | 105 std::array<uint32_t, CS_NUM> Stats; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 /// TimerList is a vector of TimerStack objects, with extra methods | 108 /// TimerList is a vector of TimerStack objects, with extra methods |
| 109 /// to initialize and merge these vectors. | 109 /// to initialize and merge these vectors. |
| 110 class TimerList : public std::vector<TimerStack> { | 110 class TimerList : public std::vector<TimerStack> { |
| 111 TimerList(const TimerList &) = delete; | 111 TimerList(const TimerList &) = delete; |
| 112 TimerList &operator=(const TimerList &) = delete; | 112 TimerList &operator=(const TimerList &) = delete; |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 604 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
| 605 ~OstreamLocker() { Ctx->unlockStr(); } | 605 ~OstreamLocker() { Ctx->unlockStr(); } |
| 606 | 606 |
| 607 private: | 607 private: |
| 608 GlobalContext *const Ctx; | 608 GlobalContext *const Ctx; |
| 609 }; | 609 }; |
| 610 | 610 |
| 611 } // end of namespace Ice | 611 } // end of namespace Ice |
| 612 | 612 |
| 613 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 613 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
| OLD | NEW |