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

Side by Side Diff: src/IceGlobalContext.h

Issue 865973006: Subzero: Make thread_local work under MacOS 10.6. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: ATTRIBUTE_TLS --> ICE_ATTRIBUTE_TLS Created 5 years, 11 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/IceDefs.h ('k') | src/IceGlobalContext.cpp » ('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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/IceDefs.h ('k') | src/IceGlobalContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698