[llvm] [ADT] Remove an extraneous variable (NFC) (PR #144937)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 19 11:07:09 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/144937
Without this patch, Int and IntWord have the same value and type.
This patch removes the extraneous copy.
>From 72df0df1e9e3377ddf7eeeee2a970805e2f697d1 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 19 Jun 2025 09:26:32 -0700
Subject: [PATCH] [ADT] Remove an extraneous variable (NFC)
Without this patch, Int and IntWord have the same value and type.
This patch removes the extraneous copy.
---
llvm/include/llvm/ADT/PointerIntPair.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
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