[LLVMdev] question on code in PointerIntPair.h

Chris Lattner clattner at apple.com
Fri Oct 9 13:52:28 PDT 2009


On Oct 8, 2009, at 10:50 AM, Maurizio Vitale wrote:

> around line 45 a bitmask is computed as:
>
>    PointerBitMask =
>      ~(uintptr_t)(((intptr_t)1 << PtrTraits::NumLowBitsAvailable)-1),
>
> my question is why is the shift performed on intptr_t? Wouldn't the
> following be ok?
>
>    PointerBitMask =
>      ~(((uintptr_t)1 << PtrTraits::NumLowBitsAvailable)-1),

Hi Maurizio, why do you ask?  Is the existing code causing a problem?

-Chris



More information about the llvm-dev mailing list