Lines Matching defs:Hash
1 //===-- Support/FoldingSet.cpp - Uniquing Hash Set --------------*- C++ -*-===//
10 // This file implements a hash set that can be used to remove duplication of
29 /// ComputeHash - Compute a strong hash value for this FoldingSetNodeIDRef,
33 unsigned Hash = static_cast<unsigned>(Size);
36 Hash += Data & 0xFFFF;
37 unsigned Tmp = ((Data >> 16) << 11) ^ Hash;
38 Hash = (Hash << 16) ^ Tmp;
39 Hash += Hash >> 11;
43 Hash ^= Hash << 3;
44 Hash += Hash >> 5;
45 Hash ^= Hash << 4;
46 Hash += Hash >> 17;
47 Hash ^= Hash << 25;
48 Hash += Hash >> 6;
49 return Hash;
63 // Note: this adds pointers to the hash using sizes and endianness that
153 /// ComputeHash - Compute a strong hash value for this FoldingSetNodeID, used to
186 /// the list circular, so we can delete a node without computing its hash.
187 /// The problem with this is that the start of the hash buckets are not
206 /// GetBucketFor - Hash the specified node ID and return the hash bucket for
208 static void **GetBucketFor(unsigned Hash, void **Buckets, unsigned NumBuckets) {
210 unsigned BucketNum = Hash & (NumBuckets-1);
227 "Initial hash table size out of range");
246 /// GrowHashTable - Double the size of the hash table and rehash everything.
267 // Insert the node into the new bucket, after recomputing the hash.
337 // Because each bucket is a circular list, we don't need to compute N's hash