[llvm-commits] [llvm] r70148 - /llvm/trunk/include/llvm/ADT/PointerIntPair.h

Chris Lattner clattner at apple.com
Sun Apr 26 12:50:25 PDT 2009


On Apr 26, 2009, at 12:46 PM, Bill Wendling wrote:

> Author: void
> Date: Sun Apr 26 14:46:41 2009
> New Revision: 70148
>
> URL: http://llvm.org/viewvc/llvm-project?rev=70148&view=rev
> Log:
> Use uint64_t instead of unsigned.

This isn't right for 32-bit hosts!

-Chris

>
>
> Modified:
>   llvm/trunk/include/llvm/ADT/PointerIntPair.h
>
> Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=70148&r1=70147&r2=70148&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original)
> +++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Sun Apr 26 14:46:41  
> 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 =
> +      ~(uint64_t)(((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 = (uint64_t)PtrTraits::NumLowBitsAvailable-IntBits,
>
>    /// IntMask - This is the unshifted mask for valid bits of the  
> int type.
> -    IntMask = ((intptr_t)1 << IntBits)-1,
> +    IntMask = (uint64_t)(((intptr_t)1 << IntBits)-1),
>
>    // ShiftedIntMask - This is the bits for the integer shifted in  
> place.
> -    ShiftedIntMask = IntMask << IntShift
> +    ShiftedIntMask = (uint64_t)(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