OLD | NEW |
1 //===- subzero/src/IceUtils.h - Utility functions ---------------*- C++ -*-===// | 1 //===- subzero/src/IceUtils.h - Utility functions ---------------*- 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 some utility functions | 10 // This file declares some utility functions |
11 // | 11 // |
12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
13 | 13 |
14 #ifndef SUBZERO_SRC_ICEUTILS_H | 14 #ifndef SUBZERO_SRC_ICEUTILS_H |
15 #define SUBZERO_SRC_ICEUTILS_H | 15 #define SUBZERO_SRC_ICEUTILS_H |
16 | 16 |
17 #include <climits> | 17 #include <climits> |
18 #include <mutex> | 18 #include <condition_variable> |
19 | 19 |
20 namespace Ice { | 20 namespace Ice { |
21 | 21 |
22 // Similar to bit_cast, but allows copying from types of unrelated | 22 // Similar to bit_cast, but allows copying from types of unrelated |
23 // sizes. This method was introduced to enable the strict aliasing | 23 // sizes. This method was introduced to enable the strict aliasing |
24 // optimizations of GCC 4.4. Basically, GCC mindlessly relies on | 24 // optimizations of GCC 4.4. Basically, GCC mindlessly relies on |
25 // obscure details in the C++ standard that make reinterpret_cast | 25 // obscure details in the C++ standard that make reinterpret_cast |
26 // virtually useless. | 26 // virtually useless. |
27 template <class D, class S> inline D bit_copy(const S &source) { | 27 template <class D, class S> inline D bit_copy(const S &source) { |
28 D destination; | 28 D destination; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 } | 178 } |
179 T *pop() { | 179 T *pop() { |
180 assert(!empty()); | 180 assert(!empty()); |
181 return WorkItems[Front++ & MaxStaticSizeMask]; | 181 return WorkItems[Front++ & MaxStaticSizeMask]; |
182 } | 182 } |
183 }; | 183 }; |
184 | 184 |
185 } // end of namespace Ice | 185 } // end of namespace Ice |
186 | 186 |
187 #endif // SUBZERO_SRC_ICEUTILS_H | 187 #endif // SUBZERO_SRC_ICEUTILS_H |
OLD | NEW |