From b79a01111d1ed14ec92b969fb995906268733c12 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Dec 2008 17:41:24 +0000 Subject: [PATCH] Move the conversion to intptr_t to a separate statement. This avoids GCC's warning even on 64-bit hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60706 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/PointerIntPair.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/llvm/ADT/PointerIntPair.h b/include/llvm/ADT/PointerIntPair.h index 9d34b44a530..176f670bb80 100644 --- a/include/llvm/ADT/PointerIntPair.h +++ b/include/llvm/ADT/PointerIntPair.h @@ -53,8 +53,9 @@ public: } void setInt(IntType Int) { - assert(intptr_t(Int) < (1 << IntBits) && "Integer too large for field"); - Value = reinterpret_cast(getPointer()) | (intptr_t)Int; + intptr_t IntVal = Int; + assert(IntVal < (1 << IntBits) && "Integer too large for field"); + Value = reinterpret_cast(getPointer()) | IntVal; } void *getOpaqueValue() const { return reinterpret_cast(Value); }