| OLD | NEW |
| 1 //===- subzero/src/IceTLS.h - thread_local workaround -----------*- C++ -*-===// | 1 //===- subzero/src/IceTLS.h - thread_local workaround -----------*- 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 27 matching lines...) Expand all Loading... |
| 38 /// any uses of ICE_TLS_GET_FIELD or ICE_TLS_SET_FIELD. | 38 /// any uses of ICE_TLS_GET_FIELD or ICE_TLS_SET_FIELD. |
| 39 /// | 39 /// |
| 40 /// \def ICE_TLS_GET_FIELD(Type, FieldName) | 40 /// \def ICE_TLS_GET_FIELD(Type, FieldName) |
| 41 /// Read the value of the static thread_local field. Must be done within the | 41 /// Read the value of the static thread_local field. Must be done within the |
| 42 /// context of its class. | 42 /// context of its class. |
| 43 /// | 43 /// |
| 44 /// \def ICE_TLS_SET_FIELD(FieldName, Value) | 44 /// \def ICE_TLS_SET_FIELD(FieldName, Value) |
| 45 /// Write a value into the static thread_local field. Must be done within the | 45 /// Write a value into the static thread_local field. Must be done within the |
| 46 /// context of its class. | 46 /// context of its class. |
| 47 | 47 |
| 48 /// \todo TODO(stichnot) | 48 /// TODO(stichnot): Limit this define to only the platforms that absolutely |
| 49 /// Limit this define to only the platforms that absolutely require it. And | 49 /// require it. And ideally, eventually remove this hack altogether. |
| 50 /// ideally, eventually remove this hack altogether. | |
| 51 /// | 50 /// |
| 52 | 51 |
| 53 /// | 52 /// |
| 54 /// \def ICE_THREAD_LOCAL_HACK | 53 /// \def ICE_THREAD_LOCAL_HACK |
| 55 /// | 54 /// |
| 56 #define ICE_THREAD_LOCAL_HACK | 55 #define ICE_THREAD_LOCAL_HACK |
| 57 #ifdef ICE_THREAD_LOCAL_HACK | 56 #ifdef ICE_THREAD_LOCAL_HACK |
| 58 | 57 |
| 59 // For a static thread_local field F of a class C, instead of declaring and | 58 // For a static thread_local field F of a class C, instead of declaring and |
| 60 // defining C::F, we create two static fields: | 59 // defining C::F, we create two static fields: |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 #define ICE_TLS_GET_FIELD(FieldName) (FieldName) | 104 #define ICE_TLS_GET_FIELD(FieldName) (FieldName) |
| 106 #define ICE_TLS_SET_FIELD(FieldName, Value) (FieldName = (Value)) | 105 #define ICE_TLS_SET_FIELD(FieldName, Value) (FieldName = (Value)) |
| 107 | 106 |
| 108 #endif // !ICE_THREAD_LOCAL_HACK | 107 #endif // !ICE_THREAD_LOCAL_HACK |
| 109 | 108 |
| 110 /// | 109 /// |
| 111 /// @} | 110 /// @} |
| 112 /// | 111 /// |
| 113 | 112 |
| 114 #endif // SUBZERO_SRC_ICETLS_H | 113 #endif // SUBZERO_SRC_ICETLS_H |
| OLD | NEW |