Index: lib/Support/FoldingSet.cpp =================================================================== --- lib/Support/FoldingSet.cpp +++ lib/Support/FoldingSet.cpp @@ -54,9 +54,17 @@ // depend on the host. It doesn't matter, however, because hashing on // pointer values is inherently unstable. Nothing should depend on the // ordering of nodes in the folding set. - Bits.append(reinterpret_cast(&Ptr), - reinterpret_cast(&Ptr+1)); + uintptr_t casted = reinterpret_cast(Ptr); + if (sizeof(uintptr_t) == sizeof(unsigned)) + AddInteger(unsigned(casted)); + else if (sizeof(uintptr_t) == sizeof(unsigned long)) + AddInteger((unsigned long)casted); + else if (sizeof(uintptr_t) == sizeof(unsigned long long)) + AddInteger((unsigned long long)casted); + else + llvm_unreachable("unexpected pointer size"); } + void FoldingSetNodeID::AddInteger(signed I) { Bits.push_back(I); }