NextPowerOf2 - Returns the next power of two (in 64-bits) that is strictly greater than A. Returns zero on overflow.
| 366 | /// NextPowerOf2 - Returns the next power of two (in 64-bits) |
| 367 | /// that is strictly greater than A. Returns zero on overflow. |
| 368 | static inline uint64_t NextPowerOf2(uint64_t A) { |
| 369 | A |= (A >> 1); |
| 370 | A |= (A >> 2); |
| 371 | A |= (A >> 4); |
| 372 | A |= (A >> 8); |
| 373 | A |= (A >> 16); |
| 374 | A |= (A >> 32); |
| 375 | return A + 1; |
| 376 | } |
| 377 | |
| 378 | /// Returns the next integer (mod 2**64) that is greater than or equal to |
| 379 | /// \p Value and is a multiple of \p Align. \p Align must be non-zero. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…