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 // This file declares aspects of the compilation that persist across | 10 // This file declares aspects of the compilation that persist across |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 LockedPtr<CodeStats> getStatsCumulative() { | 267 LockedPtr<CodeStats> getStatsCumulative() { |
268 return LockedPtr<CodeStats>(&StatsCumulative, &StatsLock); | 268 return LockedPtr<CodeStats>(&StatsCumulative, &StatsLock); |
269 } | 269 } |
270 LockedPtr<std::vector<TimerStack>> getTimers() { | 270 LockedPtr<std::vector<TimerStack>> getTimers() { |
271 return LockedPtr<std::vector<TimerStack>>(&Timers, &TimerLock); | 271 return LockedPtr<std::vector<TimerStack>>(&Timers, &TimerLock); |
272 } | 272 } |
273 | 273 |
274 std::vector<ThreadContext *> AllThreadContexts; | 274 std::vector<ThreadContext *> AllThreadContexts; |
275 // Each thread has its own TLS pointer which is also held in | 275 // Each thread has its own TLS pointer which is also held in |
276 // AllThreadContexts. | 276 // AllThreadContexts. |
277 thread_local static ThreadContext *TLS; | 277 ICE_ATTRIBUTE_TLS static ThreadContext *TLS; |
278 | 278 |
279 // Private helpers for mangleName() | 279 // Private helpers for mangleName() |
280 typedef llvm::SmallVector<char, 32> ManglerVector; | 280 typedef llvm::SmallVector<char, 32> ManglerVector; |
281 void incrementSubstitutions(ManglerVector &OldName) const; | 281 void incrementSubstitutions(ManglerVector &OldName) const; |
282 }; | 282 }; |
283 | 283 |
284 // Helper class to push and pop a timer marker. The constructor | 284 // Helper class to push and pop a timer marker. The constructor |
285 // pushes a marker, and the destructor pops it. This is for | 285 // pushes a marker, and the destructor pops it. This is for |
286 // convenient timing of regions of code. | 286 // convenient timing of regions of code. |
287 class TimerMarker { | 287 class TimerMarker { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } | 322 explicit OstreamLocker(GlobalContext *Ctx) : Ctx(Ctx) { Ctx->lockStr(); } |
323 ~OstreamLocker() { Ctx->unlockStr(); } | 323 ~OstreamLocker() { Ctx->unlockStr(); } |
324 | 324 |
325 private: | 325 private: |
326 GlobalContext *const Ctx; | 326 GlobalContext *const Ctx; |
327 }; | 327 }; |
328 | 328 |
329 } // end of namespace Ice | 329 } // end of namespace Ice |
330 | 330 |
331 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H | 331 #endif // SUBZERO_SRC_ICEGLOBALCONTEXT_H |
OLD | NEW |