LLVM 24.0.0git
llvm::FoldingSetImpl< T, Trait > Class Template Reference

An implementation detail that lets us share code between FoldingSet and ContextualFoldingSet. More...

#include "llvm/ADT/FoldingSet.h"

Inheritance diagram for llvm::FoldingSetImpl< T, Trait >:
[legend]

Public Types

using iterator = FoldingSetIterator<T>
using const_iterator = FoldingSetIterator<const T>

Public Member Functions

 FoldingSetImpl (unsigned Log2InitSize=6)
template<typename C, typename = std::enable_if_t<std::is_constructible_v< typename Trait::ContextStorage, C>>>
 FoldingSetImpl (C &&Context, unsigned Log2InitSize=6)
 FoldingSetImpl (FoldingSetImpl &&Arg)=default
FoldingSetImploperator= (FoldingSetImpl &&RHS)=default
 ~FoldingSetImpl ()=default
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
bool erase (T *N)
 Remove a node from the folding set, returning true if one was removed or false if the node was not in the folding set.
bool RemoveNode (T *N)
TgetOrInsert (T *N)
 If there is an existing node exactly equal to the specified node, return it.
TGetOrInsertNode (T *N)
Tlookup (const FoldingSetNodeID &ID, FoldingSetInsertToken &Token)
 Look up the node specified by ID.
TFindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos)
void insert (T *N, FoldingSetInsertToken Token)
 Insert the specified node into the folding set, knowing that it is not already in the folding set.
void InsertNode (T *N, void *InsertPos)
void insert (T *N)
 Insert the specified node into the folding set, knowing that it is not already in the folding set.
void InsertNode (T *N)
Public Member Functions inherited from llvm::FoldingSetBase
LLVM_ABI void clear ()
 Remove all nodes from the folding set.
unsigned size () const
 Returns the number of nodes in the folding set.
bool empty () const
 Returns true if there are no nodes in the folding set.
LLVM_ABI void reserve (unsigned N)
 Grow the number of buckets so that we can hold at least N nodes before rebucketing.
Public Member Functions inherited from llvm::DebugEpochBase
void incrementEpoch ()

Additional Inherited Members

Protected Member Functions inherited from llvm::FoldingSetBase
LLVM_ABI FoldingSetBase (unsigned Log2InitSize)
LLVM_ABI FoldingSetBase (FoldingSetBase &&Arg)
LLVM_ABI FoldingSetBaseoperator= (FoldingSetBase &&RHS)
LLVM_ABI ~FoldingSetBase ()
LLVM_ABI bool RemoveNode (Node *N)
 Remove a node from the folding set, returning true if one was removed or false if the node was not in the folding set.
LLVM_ABI NodeGetOrInsertNode (Node *N, const FoldingSetInfo &Info)
 If there is an existing node exactly equal to the node N, return it.
LLVM_ABI Nodelookup (const FoldingSetNodeID &ID, FoldingSetInsertToken &Token, const FoldingSetInfo &Info)
 Look up the node specified by ID.
LLVM_ABI NodeFindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos, const FoldingSetInfo &Info)
LLVM_ABI void insert (Node *N, FoldingSetInsertToken Token)
 Insert the specified node into the folding set, knowing that it is not already in the folding set.
LLVM_ABI void InsertNode (Node *N, void *InsertPos)
Protected Attributes inherited from llvm::FoldingSetBase
void ** Buckets = nullptr
 Array of node pointers; a null entry marks an empty slot.
unsigned NumBuckets = 0
 Length of the Buckets array. Always a power of 2.
unsigned NumNodes = 0
 Number of nodes in the folding set.

Detailed Description

template<class T, class Trait = FoldingSetTrait<T>>
class llvm::FoldingSetImpl< T, Trait >

An implementation detail that lets us share code between FoldingSet and ContextualFoldingSet.

Definition at line 445 of file FoldingSet.h.

Member Typedef Documentation

◆ const_iterator

template<class T, class Trait = FoldingSetTrait<T>>
using llvm::FoldingSetImpl< T, Trait >::const_iterator = FoldingSetIterator<const T>

Definition at line 496 of file FoldingSet.h.

◆ iterator

template<class T, class Trait = FoldingSetTrait<T>>
using llvm::FoldingSetImpl< T, Trait >::iterator = FoldingSetIterator<T>

Definition at line 489 of file FoldingSet.h.

Constructor & Destructor Documentation

◆ FoldingSetImpl() [1/3]

template<class T, class Trait = FoldingSetTrait<T>>
llvm::FoldingSetImpl< T, Trait >::FoldingSetImpl ( unsigned Log2InitSize = 6)
inlineexplicit

Definition at line 475 of file FoldingSet.h.

◆ FoldingSetImpl() [2/3]

template<class T, class Trait = FoldingSetTrait<T>>
template<typename C, typename = std::enable_if_t<std::is_constructible_v< typename Trait::ContextStorage, C>>>
llvm::FoldingSetImpl< T, Trait >::FoldingSetImpl ( C && Context,
unsigned Log2InitSize = 6 )
inlineexplicit

Definition at line 480 of file FoldingSet.h.

◆ FoldingSetImpl() [3/3]

template<class T, class Trait = FoldingSetTrait<T>>
llvm::FoldingSetImpl< T, Trait >::FoldingSetImpl ( FoldingSetImpl< T, Trait > && Arg)
default

◆ ~FoldingSetImpl()

template<class T, class Trait = FoldingSetTrait<T>>
llvm::FoldingSetImpl< T, Trait >::~FoldingSetImpl ( )
default

Member Function Documentation

◆ begin() [1/2]

template<class T, class Trait = FoldingSetTrait<T>>
iterator llvm::FoldingSetImpl< T, Trait >::begin ( )
inline

Definition at line 491 of file FoldingSet.h.

◆ begin() [2/2]

template<class T, class Trait = FoldingSetTrait<T>>
const_iterator llvm::FoldingSetImpl< T, Trait >::begin ( ) const
inline

Definition at line 498 of file FoldingSet.h.

◆ end() [1/2]

template<class T, class Trait = FoldingSetTrait<T>>
iterator llvm::FoldingSetImpl< T, Trait >::end ( )
inline

Definition at line 492 of file FoldingSet.h.

◆ end() [2/2]

template<class T, class Trait = FoldingSetTrait<T>>
const_iterator llvm::FoldingSetImpl< T, Trait >::end ( ) const
inline

Definition at line 501 of file FoldingSet.h.

◆ erase()

template<class T, class Trait = FoldingSetTrait<T>>
bool llvm::FoldingSetImpl< T, Trait >::erase ( T * N)
inline

Remove a node from the folding set, returning true if one was removed or false if the node was not in the folding set.

Definition at line 507 of file FoldingSet.h.

Referenced by llvm::FoldingSetImpl< T, Trait >< ListTy >::RemoveNode().

◆ FindNodeOrInsertPos()

template<class T, class Trait = FoldingSetTrait<T>>
T * llvm::FoldingSetImpl< T, Trait >::FindNodeOrInsertPos ( const FoldingSetNodeID & ID,
void *& InsertPos )
inline

Definition at line 524 of file FoldingSet.h.

◆ getOrInsert()

template<class T, class Trait = FoldingSetTrait<T>>
T * llvm::FoldingSetImpl< T, Trait >::getOrInsert ( T * N)
inline

If there is an existing node exactly equal to the specified node, return it.

Otherwise, insert 'N' and return it instead.

Definition at line 512 of file FoldingSet.h.

Referenced by llvm::FoldingSetImpl< T, Trait >< ListTy >::GetOrInsertNode(), and llvm::FoldingSetImpl< T, Trait >< ListTy >::insert().

◆ GetOrInsertNode()

template<class T, class Trait = FoldingSetTrait<T>>
T * llvm::FoldingSetImpl< T, Trait >::GetOrInsertNode ( T * N)
inline

Definition at line 516 of file FoldingSet.h.

◆ insert() [1/2]

template<class T, class Trait = FoldingSetTrait<T>>
void llvm::FoldingSetImpl< T, Trait >::insert ( T * N)
inline

Insert the specified node into the folding set, knowing that it is not already in the folding set.

Definition at line 541 of file FoldingSet.h.

◆ insert() [2/2]

template<class T, class Trait = FoldingSetTrait<T>>
void llvm::FoldingSetImpl< T, Trait >::insert ( T * N,
FoldingSetInsertToken Token )
inline

Insert the specified node into the folding set, knowing that it is not already in the folding set.

Token must come from lookup for an ID that N profiles identically to.

Definition at line 532 of file FoldingSet.h.

Referenced by llvm::RecordRecTy::get(), and llvm::FoldingSetImpl< T, Trait >< ListTy >::InsertNode().

◆ InsertNode() [1/2]

template<class T, class Trait = FoldingSetTrait<T>>
void llvm::FoldingSetImpl< T, Trait >::InsertNode ( T * N)
inline

Definition at line 546 of file FoldingSet.h.

◆ InsertNode() [2/2]

template<class T, class Trait = FoldingSetTrait<T>>
void llvm::FoldingSetImpl< T, Trait >::InsertNode ( T * N,
void * InsertPos )
inline

Definition at line 535 of file FoldingSet.h.

◆ lookup()

template<class T, class Trait = FoldingSetTrait<T>>
T * llvm::FoldingSetImpl< T, Trait >::lookup ( const FoldingSetNodeID & ID,
FoldingSetInsertToken & Token )
inline

Look up the node specified by ID.

If it exists, return it and clear Token; otherwise return null and set Token for a subsequent insert.

Definition at line 520 of file FoldingSet.h.

Referenced by llvm::RecordRecTy::get().

◆ operator=()

template<class T, class Trait = FoldingSetTrait<T>>
FoldingSetImpl & llvm::FoldingSetImpl< T, Trait >::operator= ( FoldingSetImpl< T, Trait > && RHS)
default

◆ RemoveNode()

template<class T, class Trait = FoldingSetTrait<T>>
bool llvm::FoldingSetImpl< T, Trait >::RemoveNode ( T * N)
inline

Definition at line 508 of file FoldingSet.h.


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