Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d594a00

Browse files
[ADT] Simplify IntMask (NFC) (#158410)
We can do the shift in uintptr_t without going through intptr_t.
1 parent d976be0 commit d594a00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ADT/PointerIntPair.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ struct PointerIntPairInfo {
180180
IntShift = (uintptr_t)PtrTraits::NumLowBitsAvailable - IntBits,
181181

182182
/// IntMask - This is the unshifted mask for valid bits of the int type.
183-
IntMask = (uintptr_t)(((intptr_t)1 << IntBits) - 1),
183+
IntMask = ((uintptr_t)1 << IntBits) - 1,
184184

185185
// ShiftedIntMask - This is the bits for the integer shifted in place.
186186
ShiftedIntMask = (uintptr_t)(IntMask << IntShift)

0 commit comments

Comments
 (0)