drive by bug fix: DenseMapInfo::isEqual should be determined according to
[oota-llvm.git] / include / llvm / ADT / PointerIntPair.h
index 64f4a7cee4b9973656d15fd77224243e25658778..85dbba2b4a4ae9b361280cb9616a3dd52bbd473f 100644 (file)
@@ -91,6 +91,13 @@ public:
     Value |= IntVal << IntShift;  // Set new integer.
   }
 
+  PointerTy const *getAddrOfPointer() const {
+    assert(Value == reinterpret_cast<intptr_t>(getPointer()) &&
+           "Can only return the address if IntBits is cleared and "
+           "PtrTraits doesn't change the pointer");
+    return reinterpret_cast<PointerTy const *>(&Value);
+  }
+
   void *getOpaqueValue() const { return reinterpret_cast<void*>(Value); }
   void setFromOpaqueValue(void *Val) { Value = reinterpret_cast<intptr_t>(Val);}