LLVM: llvm::TrieHashIndexGenerator Struct Reference (original) (raw)
The utility class that helps computing the index of the object inside trie from its hash. More...
The utility class that helps computing the index of the object inside trie from its hash.
The generator can be configured with the number of bits used for each level of trie structure with NumRootsBits and NumSubtrieBits. For example, try computing indexes for a 16-bit hash 0x1234 with 8-bit root and 4-bit sub-trie:
IndexGenerator IndexGen{8, 4, Hash}; size_t index1 = IndexGen.next(); // index 18 in root node. size_t index2 = IndexGen.next(); // index 3 in sub-trie level 1. size_t index3 = IndexGen.next(); // index 4 in sub-tire level 2.
This is used by different trie implementation to figure out where to insert/find the object in the data structure.
Definition at line 31 of file TrieHashIndexGenerator.h.