summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-04-18 10:37:32 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-04-18 10:37:32 +0000
commit4bb87cbac50098acc6816390c00fad419d3434fc (patch)
treeb3bbab8a00d1dfb1ba056988e41790c5ce6d7895 /include
parent9a1484165cd7cc3b95f5f65f845257c44f55a5b3 (diff)
downloadllvm-4bb87cbac50098acc6816390c00fad419d3434fc.tar.gz
llvm-4bb87cbac50098acc6816390c00fad419d3434fc.tar.bz2
llvm-4bb87cbac50098acc6816390c00fad419d3434fc.tar.xz
SmallPtrSet: Reuse DenseMapInfo's pointer hash function instead of inventing a bad one ourselves.
DenseMap's hash function uses slightly more entropy and reduces hash collisions significantly. I also experimented with Hashing.h, but it didn't gave a lot of improvement while being much more expensive to compute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154996 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/SmallPtrSet.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/include/llvm/ADT/SmallPtrSet.h b/include/llvm/ADT/SmallPtrSet.h
index 70693d5b9a..498a0345d8 100644
--- a/include/llvm/ADT/SmallPtrSet.h
+++ b/include/llvm/ADT/SmallPtrSet.h
@@ -126,9 +126,6 @@ protected:
private:
bool isSmall() const { return CurArray == SmallArray; }
- unsigned Hash(const void *Ptr) const {
- return static_cast<unsigned>(((uintptr_t)Ptr >> 4) & (CurArraySize-1));
- }
const void * const *FindBucketFor(const void *Ptr) const;
void shrink_and_clear();