Skip to content

Commit 7349864

Browse files
[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.
1 parent dc058a3 commit 7349864

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/include/llvm/ADT/PointerIntPair.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,10 @@ struct PointerIntPairInfo {
206206
}
207207

208208
static intptr_t updateInt(intptr_t OrigValue, intptr_t Int) {
209-
intptr_t IntWord = static_cast<intptr_t>(Int);
210-
assert((IntWord & ~IntMask) == 0 && "Integer too large for field");
209+
assert((Int & ~IntMask) == 0 && "Integer too large for field");
211210

212211
// Preserve all bits other than the ones we are updating.
213-
return (OrigValue & ~ShiftedIntMask) | IntWord << IntShift;
212+
return (OrigValue & ~ShiftedIntMask) | Int << IntShift;
214213
}
215214
};
216215

0 commit comments

Comments
 (0)