don't use intptr_t without including it.
authorChris Lattner <sabre@nondot.org>
Fri, 12 Oct 2007 18:16:23 +0000 (18:16 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 12 Oct 2007 18:16:23 +0000 (18:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42921 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringMap.h

index 7f8657e560904147bd1273a912a364a29ac655d6..2dff04c504517ee80aa7794beea8316339560e17 100644 (file)
@@ -172,7 +172,9 @@ public:
   /// into a StringMapEntry, return the StringMapEntry itself.
   static StringMapEntry &GetStringMapEntryFromValue(ValueTy &V) {
     StringMapEntry *EPtr = 0;
-    char *Ptr = reinterpret_cast<char*>(&V) - (intptr_t)&EPtr->Val;
+    char *Ptr = reinterpret_cast<char*>(&V) - 
+                  (reinterpret_cast<char*>(&EPtr->Val) - 
+                   reinterpret_cast<char*>(EPtr));
     return *reinterpret_cast<StringMapEntry*>(Ptr);
   }
   static const StringMapEntry &GetStringMapEntryFromValue(const ValueTy &V) {