aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/PointerIntPair.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-12-08 17:41:24 +0000
committerDan Gohman <gohman@apple.com>2008-12-08 17:41:24 +0000
commit5b25fcf6dff1718eabc726c45cdea7443be93266 (patch)
treebbfe66a80498f2091dbfdb517f73876e349dfd40 /include/llvm/ADT/PointerIntPair.h
parent653cc452e1f0afe57387abf410c3461e5be8e1fb (diff)
downloadexternal_llvm-5b25fcf6dff1718eabc726c45cdea7443be93266.zip
external_llvm-5b25fcf6dff1718eabc726c45cdea7443be93266.tar.gz
external_llvm-5b25fcf6dff1718eabc726c45cdea7443be93266.tar.bz2
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
Diffstat (limited to 'include/llvm/ADT/PointerIntPair.h')
-rw-r--r--include/llvm/ADT/PointerIntPair.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/ADT/PointerIntPair.h b/include/llvm/ADT/PointerIntPair.h
index 9d34b44a..176f670 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<intptr_t>(getPointer()) | (intptr_t)Int;
+ intptr_t IntVal = Int;
+ assert(IntVal < (1 << IntBits) && "Integer too large for field");
+ Value = reinterpret_cast<intptr_t>(getPointer()) | IntVal;
}
void *getOpaqueValue() const { return reinterpret_cast<void*>(Value); }