From: Benjamin Kramer Date: Mon, 18 Jul 2011 00:00:20 +0000 (+0000) Subject: Simplify & microoptimize code. No intended functionality change. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8d4dd79526c434b9346d810dbee5a91e63b86bdf;p=oota-llvm.git Simplify & microoptimize code. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135364 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/FoldingSet.cpp b/lib/Support/FoldingSet.cpp index 1568342e9c9..17b827132f5 100644 --- a/lib/Support/FoldingSet.cpp +++ b/lib/Support/FoldingSet.cpp @@ -64,10 +64,8 @@ void FoldingSetNodeID::AddPointer(const void *Ptr) { // depend on the host. It doesn't matter however, because hashing on // pointer values in inherently unstable. Nothing should depend on the // ordering of nodes in the folding set. - intptr_t PtrI = (intptr_t)Ptr; - Bits.push_back(unsigned(PtrI)); - if (sizeof(intptr_t) > sizeof(unsigned)) - Bits.push_back(unsigned(uint64_t(PtrI) >> 32)); + Bits.append(reinterpret_cast(&Ptr), + reinterpret_cast(&Ptr+1)); } void FoldingSetNodeID::AddInteger(signed I) { Bits.push_back(I);