[llvm-commits] [llvm] r60706 - /llvm/trunk/include/llvm/ADT/PointerIntPair.h
Dan Gohman
gohman at apple.com
Mon Dec 8 09:41:25 PST 2008
Author: djg
Date: Mon Dec 8 11:41:24 2008
New Revision: 60706
URL: http://llvm.org/viewvc/llvm-project?rev=60706&view=rev
Log:
Move the conversion to intptr_t to a separate statement. This
avoids GCC's warning even on 64-bit hosts.
Modified:
llvm/trunk/include/llvm/ADT/PointerIntPair.h
Modified: llvm/trunk/include/llvm/ADT/PointerIntPair.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerIntPair.h?rev=60706&r1=60705&r2=60706&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/PointerIntPair.h (original)
+++ llvm/trunk/include/llvm/ADT/PointerIntPair.h Mon Dec 8 11:41:24 2008
@@ -53,8 +53,9 @@
}
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); }
More information about the llvm-commits
mailing list