[llvm] 7349864 - [ADT] Remove an extraneous variable (NFC) (#144937)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 19 13:17:34 PDT 2025
Author: Kazu Hirata
Date: 2025-06-19T13:17:31-07:00
New Revision: 7349864d2c7c874c17ed546791489a46e896f901
URL: https://github.com/llvm/llvm-project/commit/7349864d2c7c874c17ed546791489a46e896f901
DIFF: https://github.com/llvm/llvm-project/commit/7349864d2c7c874c17ed546791489a46e896f901.diff
LOG: [ADT] Remove an extraneous variable (NFC) (#144937)
Without this patch, Int and IntWord have the same value and type.
This patch removes the extraneous copy.
Added:
Modified:
llvm/include/llvm/ADT/PointerIntPair.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/PointerIntPair.h b/llvm/include/llvm/ADT/PointerIntPair.h
index f73f5bcd6ce0c..9cfc65846d5bf 100644
--- a/llvm/include/llvm/ADT/PointerIntPair.h
+++ b/llvm/include/llvm/ADT/PointerIntPair.h
@@ -206,11 +206,10 @@ struct PointerIntPairInfo {
}
static intptr_t updateInt(intptr_t OrigValue, intptr_t Int) {
- intptr_t IntWord = static_cast<intptr_t>(Int);
- assert((IntWord & ~IntMask) == 0 && "Integer too large for field");
+ assert((Int & ~IntMask) == 0 && "Integer too large for field");
// Preserve all bits other than the ones we are updating.
- return (OrigValue & ~ShiftedIntMask) | IntWord << IntShift;
+ return (OrigValue & ~ShiftedIntMask) | Int << IntShift;
}
};
More information about the llvm-commits
mailing list