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 |
JF
2015/01/28 16:54:27
Missing period.
Jim Stichnoth
2015/01/28 16:55:22
Will fix in a separate CL.
| |
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> | |
JF
2015/01/28 22:06:42
Actually, instead of being snarky and having fun I
JF
2015/01/28 22:19:21
Fixed here:
https://codereview.chromium.org/8842
| |
18 | 19 |
19 namespace Ice { | 20 namespace Ice { |
20 | 21 |
21 // Similar to bit_cast, but allows copying from types of unrelated | 22 // Similar to bit_cast, but allows copying from types of unrelated |
22 // sizes. This method was introduced to enable the strict aliasing | 23 // sizes. This method was introduced to enable the strict aliasing |
23 // optimizations of GCC 4.4. Basically, GCC mindlessly relies on | 24 // optimizations of GCC 4.4. Basically, GCC mindlessly relies on |
24 // obscure details in the C++ standard that make reinterpret_cast | 25 // obscure details in the C++ standard that make reinterpret_cast |
25 // virtually useless. | 26 // virtually useless. |
26 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) { |
27 D destination; | 28 D destination; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 } | 178 } |
178 T *pop() { | 179 T *pop() { |
179 assert(!empty()); | 180 assert(!empty()); |
180 return WorkItems[Front++ & MaxStaticSizeMask]; | 181 return WorkItems[Front++ & MaxStaticSizeMask]; |
181 } | 182 } |
182 }; | 183 }; |
183 | 184 |
184 } // end of namespace Ice | 185 } // end of namespace Ice |
185 | 186 |
186 #endif // SUBZERO_SRC_ICEUTILS_H | 187 #endif // SUBZERO_SRC_ICEUTILS_H |
OLD | NEW |