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
void reserve (unsigned EltCount)
 Grow the number of buckets so that we can hold at least EltCount nodes before rebucketing.
bool RemoveNode (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.
TGetOrInsertNode (T *N)
 If there is an existing node exactly equal to the specified node, return it.
TFindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos)
 Look up the node specified by ID.
void InsertNode (T *N, void *InsertPos)
 Insert the specified node into the folding set, knowing that it is not already in the folding set.
void InsertNode (T *N)
 Insert the specified node into the folding set, knowing that it is not already in the folding set.
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.
unsigned capacity () const
 Returns the number of nodes permitted in the folding set before a rebucket operation is performed.
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 void reserve (unsigned EltCount, const FoldingSetInfo &Info)
 Grow the number of buckets so that we can hold at least EltCount nodes before rebucketing.
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 NodeFindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos, const FoldingSetInfo &Info)
 Look up the node specified by ID.
LLVM_ABI void InsertNode (Node *N, void *InsertPos, const FoldingSetInfo &Info)
 Insert the specified node into the folding set, knowing that it is not already in the folding set.
Protected Attributes inherited from llvm::FoldingSetBase
void ** Buckets
 Array of bucket chains.
unsigned NumBuckets
 Length of the Buckets array. Always a power of 2.
unsigned NumNodes
 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 443 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 503 of file FoldingSet.h.

◆ iterator

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

Definition at line 498 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 484 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 489 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 500 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 505 of file FoldingSet.h.

◆ end() [1/2]

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

Definition at line 501 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 506 of file FoldingSet.h.

◆ FindNodeOrInsertPos()

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

Look up the node specified by ID.

If it exists, return it. If not, return the insertion token that will make insertion faster.

Definition at line 529 of file FoldingSet.h.

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

◆ GetOrInsertNode()

template<class T, class Trait = FoldingSetTrait<T>>
T * llvm::FoldingSetImpl< T, Trait >::GetOrInsertNode ( 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 522 of file FoldingSet.h.

Referenced by 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

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

Definition at line 543 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

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

InsertPos must be obtained from FindNodeOrInsertPos.

Definition at line 537 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

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 518 of file FoldingSet.h.

◆ reserve()

template<class T, class Trait = FoldingSetTrait<T>>
void llvm::FoldingSetImpl< T, Trait >::reserve ( unsigned EltCount)
inline

Grow the number of buckets so that we can hold at least EltCount nodes before rebucketing.

May allocate more space than requested.

Definition at line 512 of file FoldingSet.h.


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