MinAlign - A and B are either alignments or offsets. Return the minimum alignment that may be assumed after adding the two together.
| 355 | /// MinAlign - A and B are either alignments or offsets. Return the minimum |
| 356 | /// alignment that may be assumed after adding the two together. |
| 357 | static inline uint64_t MinAlign(uint64_t A, uint64_t B) { |
| 358 | // The largest power of 2 that divides both A and B. |
| 359 | // |
| 360 | // Replace "-Value" by "1+~Value" in the following commented code to avoid |
| 361 | // MSVC warning C4146 |
| 362 | // return (A | B) & -(A | B); |
| 363 | return (A | B) & (1 + ~(A | B)); |
| 364 | } |
| 365 | |
| 366 | /// NextPowerOf2 - Returns the next power of two (in 64-bits) |
| 367 | /// that is strictly greater than A. Returns zero on overflow. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…