[llvm-commits] [llvm] r70140 - /llvm/tags/Apple/llvmCore-2107.1/include/llvm/ADT/PointerIntPair.h
Chris Lattner
clattner at apple.com
Sun Apr 26 11:42:20 PDT 2009
On Apr 26, 2009, at 11:12 AM, Bill Wendling wrote:
> Author: void
> Date: Sun Apr 26 13:12:38 2009
> New Revision: 70140
>
> URL: http://llvm.org/viewvc/llvm-project?rev=70140&view=rev
> Log:
> Suppress warnings about conversion shortening 64-bit to 32-bit.
Bill, I don't think this is safe on 64-bit systems. PointerBitMask
will be 32-bit not 64-bit. How about casting to uint64_t instead of
unsigned?
-Chris
>
>
> Modified:
> llvm/tags/Apple/llvmCore-2107.1/include/llvm/ADT/PointerIntPair.h
>
> Modified: llvm/tags/Apple/llvmCore-2107.1/include/llvm/ADT/
> PointerIntPair.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2107.1/include/llvm/ADT/PointerIntPair.h?rev=70140&r1=70139&r2=70140&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/tags/Apple/llvmCore-2107.1/include/llvm/ADT/
> PointerIntPair.h (original)
> +++ llvm/tags/Apple/llvmCore-2107.1/include/llvm/ADT/
> PointerIntPair.h Sun Apr 26 13:12:38 2009
> @@ -42,16 +42,18 @@
> intptr_t Value;
> enum {
> /// PointerBitMask - The bits that come from the pointer.
> - PointerBitMask = ~(((intptr_t)1 <<
> PtrTraits::NumLowBitsAvailable)-1),
> + PointerBitMask =
> + ~(unsigned)(((intptr_t)1 << PtrTraits::NumLowBitsAvailable)-1),
> +
> /// IntShift - The number of low bits that we reserve for other
> uses, and
> /// keep zero.
> - IntShift = PtrTraits::NumLowBitsAvailable-IntBits,
> + IntShift = (unsigned)PtrTraits::NumLowBitsAvailable-IntBits,
>
> /// IntMask - This is the unshifted mask for valid bits of the
> int type.
> - IntMask = ((intptr_t)1 << IntBits)-1,
> + IntMask = (unsigned)(((intptr_t)1 << IntBits)-1),
>
> // ShiftedIntMask - This is the bits for the integer shifted in
> place.
> - ShiftedIntMask = IntMask << IntShift
> + ShiftedIntMask = (unsigned)(IntMask << IntShift)
> };
> public:
> PointerIntPair() : Value(0) {}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list