-
Notifications
You must be signed in to change notification settings - Fork 15k
[ADT] Simplify IntMask (NFC) #158410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADT] Simplify IntMask (NFC) #158410
Conversation
We can do the shift in uintptr_t without going through intptr_t.
@llvm/pr-subscribers-llvm-adt Author: Kazu Hirata (kazutakahirata) ChangesWe can do the shift in uintptr_t without going through intptr_t. Full diff: https://github.com/llvm/llvm-project/pull/158410.diff 1 Files Affected:
diff --git a/llvm/include/llvm/ADT/PointerIntPair.h b/llvm/include/llvm/ADT/PointerIntPair.h
index e48e35d476c80..75e3a58e7ca61 100644
--- a/llvm/include/llvm/ADT/PointerIntPair.h
+++ b/llvm/include/llvm/ADT/PointerIntPair.h
@@ -180,7 +180,7 @@ struct PointerIntPairInfo {
IntShift = (uintptr_t)PtrTraits::NumLowBitsAvailable - IntBits,
/// IntMask - This is the unshifted mask for valid bits of the int type.
- IntMask = (uintptr_t)(((intptr_t)1 << IntBits) - 1),
+ IntMask = ((uintptr_t)1 << IntBits) - 1,
// ShiftedIntMask - This is the bits for the integer shifted in place.
ShiftedIntMask = (uintptr_t)(IntMask << IntShift)
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/16011 Here is the relevant piece of the build log for the reference
|
We can do the shift in uintptr_t without going through intptr_t.