[ADT] Another stab at fixing the PointerEmbeddedInt build for MSVC.

MSVC18 seems to have other problems here, just hardcode uintptr_t.

llvm-svn: 257289
This commit is contained in:
Benjamin Kramer 2016-01-10 14:27:26 +00:00
parent 8b47610c32
commit acad32d8e1
1 changed files with 2 additions and 2 deletions

View File

@ -30,13 +30,13 @@ template <typename IntT, int Bits = sizeof(IntT) * CHAR_BIT>
class PointerEmbeddedInt {
uintptr_t Value;
static_assert(Bits < sizeof(PointerEmbeddedInt::Value) * CHAR_BIT,
static_assert(Bits < sizeof(uintptr_t) * CHAR_BIT,
"Cannot embed more bits than we have in a pointer!");
enum : uintptr_t {
// We shift as many zeros into the value as we can while preserving the
// number of bits desired for the integer.
Shift = sizeof(PointerEmbeddedInt::Value) * CHAR_BIT - Bits,
Shift = sizeof(uintptr_t) * CHAR_BIT - Bits,
// We also want to be able to mask out the preserved bits for asserts.
Mask = static_cast<uintptr_t>(-1) << Bits