summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/FoldingSet.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-07-18 00:00:20 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-07-18 00:00:20 +0000
commit2b8cb92209b41db469244048aa06511de0477b3a (patch)
treea34b6f274f23309c017220f983519fddbe230cd0 /llvm/lib/Support/FoldingSet.cpp
parent3a29bdbe9b4217e47e0689a4c310ab198a4b71d5 (diff)
downloadbcm5719-llvm-2b8cb92209b41db469244048aa06511de0477b3a.tar.gz
bcm5719-llvm-2b8cb92209b41db469244048aa06511de0477b3a.zip
Simplify & microoptimize code. No intended functionality change.
llvm-svn: 135364
Diffstat (limited to 'llvm/lib/Support/FoldingSet.cpp')
-rw-r--r--llvm/lib/Support/FoldingSet.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Support/FoldingSet.cpp b/llvm/lib/Support/FoldingSet.cpp
index 1568342e9c9..17b827132f5 100644
--- a/llvm/lib/Support/FoldingSet.cpp
+++ b/llvm/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<unsigned *>(&Ptr),
+ reinterpret_cast<unsigned *>(&Ptr+1));
}
void FoldingSetNodeID::AddInteger(signed I) {
Bits.push_back(I);
OpenPOWER on IntegriCloud