Fix sentinels to use correctly 'aligned' pointers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60229 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-11-29 01:36:16 +00:00
parent 9ac30537aa
commit d63e618212

View File

@ -73,11 +73,11 @@ template<typename PointerTy, unsigned IntBits, typename IntType>
struct DenseMapInfo<PointerIntPair<PointerTy, IntBits, IntType> > {
typedef PointerIntPair<PointerTy, IntBits, IntType> Ty;
static Ty getEmptyKey() {
return Ty(reinterpret_cast<PointerTy>(-1),
return Ty(reinterpret_cast<PointerTy>(-1 << IntBits),
IntType((1 << IntBits)-1));
}
static Ty getTombstoneKey() {
return Ty(reinterpret_cast<PointerTy>(-2), IntType(0));
return Ty(reinterpret_cast<PointerTy>(-2 << IntBits), IntType(0));
}
static unsigned getHashValue(Ty V) {
uintptr_t IV = reinterpret_cast<uintptr_t>(V.getOpaqueValue());