LLVM 22.0.0git
llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes > Class Template Reference

Lock-free thread-safe hash-mapped trie. More...

#include "llvm/ADT/TrieRawHashMap.h"

Inheritance diagram for llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >:
[legend]

Classes

class  const_pointer
class  LazyValueConstructor
class  pointer
struct  value_type

Public Types

using HashT = std::array<uint8_t, NumHashBytes>
using HashType = HashT

Public Member Functions

pointer insertLazy (const_pointer Hint, ArrayRef< uint8_t > Hash, function_ref< void(LazyValueConstructor)> OnConstruct)
 Insert with a hint.
pointer insertLazy (ArrayRef< uint8_t > Hash, function_ref< void(LazyValueConstructor)> OnConstruct)
pointer insert (const_pointer Hint, value_type &&HashedData)
pointer insert (const_pointer Hint, const value_type &HashedData)
pointer find (ArrayRef< uint8_t > Hash)
const_pointer find (ArrayRef< uint8_t > Hash) const
 ThreadSafeTrieRawHashMap (std::optional< size_t > NumRootBits=std::nullopt, std::optional< size_t > NumSubtrieBits=std::nullopt)
 ~ThreadSafeTrieRawHashMap ()
 ThreadSafeTrieRawHashMap (ThreadSafeTrieRawHashMap &&)=default
ThreadSafeTrieRawHashMapoperator= (ThreadSafeTrieRawHashMap &&)=delete
 ThreadSafeTrieRawHashMap (const ThreadSafeTrieRawHashMap &)=delete
ThreadSafeTrieRawHashMapoperator= (const ThreadSafeTrieRawHashMap &)=delete
void operator delete (void *Ptr)
LLVM_DUMP_METHOD void dump () const
LLVM_ABI void print (raw_ostream &OS) const
Public Member Functions inherited from llvm::ThreadSafeTrieRawHashMapBase
void operator delete (void *Ptr)
LLVM_DUMP_METHOD void dump () const
LLVM_ABI void print (raw_ostream &OS) const

Additional Inherited Members

Static Public Member Functions inherited from llvm::ThreadSafeTrieRawHashMapBase
static void * operator new (size_t Size)
Static Public Attributes inherited from llvm::ThreadSafeTrieRawHashMapBase
static constexpr size_t TrieContentBaseSize = 4
static constexpr size_t DefaultNumRootBits = 6
static constexpr size_t DefaultNumSubtrieBits = 4
Protected Member Functions inherited from llvm::ThreadSafeTrieRawHashMapBase
LLVM_ABI PointerBase find (ArrayRef< uint8_t > Hash) const
 Find the stored content with hash.
LLVM_ABI PointerBase insert (PointerBase Hint, ArrayRef< uint8_t > Hash, function_ref< const uint8_t *(void *Mem, ArrayRef< uint8_t > Hash)> Constructor)
 Insert and return the stored content.
 ThreadSafeTrieRawHashMapBase ()=delete
LLVM_ABI ThreadSafeTrieRawHashMapBase (size_t ContentAllocSize, size_t ContentAllocAlign, size_t ContentOffset, std::optional< size_t > NumRootBits=std::nullopt, std::optional< size_t > NumSubtrieBits=std::nullopt)
LLVM_ABI ~ThreadSafeTrieRawHashMapBase ()
 Destructor, which asserts if there's anything to do.
LLVM_ABI void destroyImpl (function_ref< void(void *ValueMem)> Destructor)
LLVM_ABI ThreadSafeTrieRawHashMapBase (ThreadSafeTrieRawHashMapBase &&RHS)
ThreadSafeTrieRawHashMapBaseoperator= (ThreadSafeTrieRawHashMapBase &&RHS)=delete
 ThreadSafeTrieRawHashMapBase (const ThreadSafeTrieRawHashMapBase &)=delete
ThreadSafeTrieRawHashMapBaseoperator= (const ThreadSafeTrieRawHashMapBase &)=delete
LLVM_ABI PointerBase getRoot () const
LLVM_ABI unsigned getStartBit (PointerBase P) const
LLVM_ABI unsigned getNumBits (PointerBase P) const
LLVM_ABI unsigned getNumSlotUsed (PointerBase P) const
LLVM_ABI std::string getTriePrefixAsString (PointerBase P) const
LLVM_ABI unsigned getNumTries () const
LLVM_ABI PointerBase getNextTrie (PointerBase P) const
Static Protected Attributes inherited from llvm::ThreadSafeTrieRawHashMapBase
template<class T>
static constexpr size_t DefaultContentAllocSize = sizeof(AllocValueType<T>)
template<class T>
static constexpr size_t DefaultContentAllocAlign = alignof(AllocValueType<T>)
template<class T>
static constexpr size_t DefaultContentOffset

Detailed Description

template<class T, size_t NumHashBytes>
class llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >

Lock-free thread-safe hash-mapped trie.

Definition at line 186 of file TrieRawHashMap.h.

Member Typedef Documentation

◆ HashT

template<class T, size_t NumHashBytes>
using llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::HashT = std::array<uint8_t, NumHashBytes>

Definition at line 188 of file TrieRawHashMap.h.

◆ HashType

template<class T, size_t NumHashBytes>
using llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::HashType = HashT

Definition at line 219 of file TrieRawHashMap.h.

Constructor & Destructor Documentation

◆ ThreadSafeTrieRawHashMap() [1/3]

template<class T, size_t NumHashBytes>
llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::ThreadSafeTrieRawHashMap ( std::optional< size_t > NumRootBits = std::nullopt,
std::optional< size_t > NumSubtrieBits = std::nullopt )
inline

Definition at line 357 of file TrieRawHashMap.h.

◆ ~ThreadSafeTrieRawHashMap()

template<class T, size_t NumHashBytes>
llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::~ThreadSafeTrieRawHashMap ( )
inline

Definition at line 364 of file TrieRawHashMap.h.

◆ ThreadSafeTrieRawHashMap() [2/3]

template<class T, size_t NumHashBytes>
llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::ThreadSafeTrieRawHashMap ( ThreadSafeTrieRawHashMap< T, NumHashBytes > && )
default

◆ ThreadSafeTrieRawHashMap() [3/3]

template<class T, size_t NumHashBytes>
llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::ThreadSafeTrieRawHashMap ( const ThreadSafeTrieRawHashMap< T, NumHashBytes > & )
delete

Member Function Documentation

◆ dump()

template<class T, size_t NumHashBytes>
LLVM_DUMP_METHOD void llvm::ThreadSafeTrieRawHashMapBase::dump ( ) const

◆ find() [1/2]

template<class T, size_t NumHashBytes>
pointer llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::find ( ArrayRef< uint8_t > Hash)
inline

Definition at line 347 of file TrieRawHashMap.h.

◆ find() [2/2]

template<class T, size_t NumHashBytes>
const_pointer llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::find ( ArrayRef< uint8_t > Hash) const
inline

Definition at line 352 of file TrieRawHashMap.h.

◆ insert() [1/2]

template<class T, size_t NumHashBytes>
pointer llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::insert ( const_pointer Hint,
const value_type & HashedData )
inline

Definition at line 342 of file TrieRawHashMap.h.

◆ insert() [2/2]

template<class T, size_t NumHashBytes>
pointer llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::insert ( const_pointer Hint,
value_type && HashedData )
inline

Definition at line 336 of file TrieRawHashMap.h.

◆ insertLazy() [1/2]

template<class T, size_t NumHashBytes>
pointer llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::insertLazy ( ArrayRef< uint8_t > Hash,
function_ref< void(LazyValueConstructor)> OnConstruct )
inline

Definition at line 331 of file TrieRawHashMap.h.

◆ insertLazy() [2/2]

template<class T, size_t NumHashBytes>
pointer llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::insertLazy ( const_pointer Hint,
ArrayRef< uint8_t > Hash,
function_ref< void(LazyValueConstructor)> OnConstruct )
inline

Insert with a hint.

Default-constructed hint will work, but it's recommended to start with a lookup to avoid overhead in object creation if it already exists.

Definition at line 321 of file TrieRawHashMap.h.

Referenced by llvm::ThreadSafeTrieRawHashMap< DataT, sizeof(HashType)>::insert(), llvm::ThreadSafeTrieRawHashMap< DataT, sizeof(HashType)>::insert(), and llvm::ThreadSafeTrieRawHashMap< DataT, sizeof(HashType)>::insertLazy().

◆ operator delete()

template<class T, size_t NumHashBytes>
void llvm::ThreadSafeTrieRawHashMapBase::operator delete ( void * Ptr)
inline

Definition at line 92 of file TrieRawHashMap.h.

◆ operator=() [1/2]

template<class T, size_t NumHashBytes>
ThreadSafeTrieRawHashMap & llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::operator= ( const ThreadSafeTrieRawHashMap< T, NumHashBytes > & )
delete

◆ operator=() [2/2]

template<class T, size_t NumHashBytes>
ThreadSafeTrieRawHashMap & llvm::ThreadSafeTrieRawHashMap< T, NumHashBytes >::operator= ( ThreadSafeTrieRawHashMap< T, NumHashBytes > && )
delete

◆ print()

template<class T, size_t NumHashBytes>
LLVM_ABI void llvm::ThreadSafeTrieRawHashMapBase::print ( raw_ostream & OS) const

The documentation for this class was generated from the following file: