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

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 10 06:27:26 PST 2016


Author: d0k
Date: Sun Jan 10 08:27:26 2016
New Revision: 257289

URL: http://llvm.org/viewvc/llvm-project?rev=257289&view=rev
Log:
[ADT] Another stab at fixing the PointerEmbeddedInt build for MSVC.

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

Modified:
    llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h

Modified: llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h?rev=257289&r1=257288&r2=257289&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h (original)
+++ llvm/trunk/include/llvm/ADT/PointerEmbeddedInt.h Sun Jan 10 08:27:26 2016
@@ -30,13 +30,13 @@ template <typename IntT, int Bits = size
 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




More information about the llvm-commits mailing list