Index: include/llvm/ADT/DenseMapInfo.h
===================================================================
--- include/llvm/ADT/DenseMapInfo.h
+++ include/llvm/ADT/DenseMapInfo.h
@@ -31,13 +31,11 @@
 template<typename T>
 struct DenseMapInfo<T*> {
   static inline T* getEmptyKey() {
-    uintptr_t Val = static_cast<uintptr_t>(-1);
-    Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
+    uintptr_t Val = static_cast<uintptr_t>(-1) - 0x3fff;
     return reinterpret_cast<T*>(Val);
   }
   static inline T* getTombstoneKey() {
-    uintptr_t Val = static_cast<uintptr_t>(-2);
-    Val <<= PointerLikeTypeTraits<T*>::NumLowBitsAvailable;
+    uintptr_t Val = static_cast<uintptr_t>(-1) - 0x7fff;
     return reinterpret_cast<T*>(Val);
   }
   static unsigned getHashValue(const T *PtrVal) {