LLVM 20.0.0git
Public Types | Public Member Functions | Protected Member Functions | List of all members
llvm::FoldingSetImpl< Derived, T > Class Template Reference

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

#include "llvm/ADT/FoldingSet.h"

Inherits llvm::FoldingSetBase.

Inherited by llvm::FoldingSet< llvm::DIEAbbrev >, llvm::FoldingSet< llvm::UniqueMachineInstr >, llvm::FoldingSet< ListTy >, llvm::FoldingSet< llvm::AttributeImpl >, llvm::FoldingSet< llvm::AttributeListImpl >, llvm::FoldingSet< llvm::AttributeSetNode >, llvm::FoldingSet< AUFoldingSetNode >, llvm::FoldingSet< llvm::SCEV >, llvm::FoldingSet< llvm::SCEVPredicate >, llvm::FoldingSet< llvm::SDVTListNode >, llvm::FoldingSet< llvm::SDNode >, llvm::FoldingSet< llvm::ArgumentInit >, llvm::FoldingSet< llvm::BitsInit >, llvm::FoldingSet< llvm::ListInit >, llvm::FoldingSet< llvm::UnOpInit >, llvm::FoldingSet< llvm::BinOpInit >, llvm::FoldingSet< llvm::TernOpInit >, llvm::FoldingSet< llvm::FoldOpInit >, llvm::FoldingSet< llvm::IsAOpInit >, llvm::FoldingSet< llvm::ExistsOpInit >, llvm::FoldingSet< llvm::VarDefInit >, llvm::FoldingSet< llvm::CondOpInit >, llvm::FoldingSet< llvm::DagInit >, and llvm::FoldingSet< llvm::RecordRecTy >.

Public Types

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

Public Member Functions

iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bucket_iterator bucket_begin (unsigned hash)
 
bucket_iterator bucket_end (unsigned hash)
 
void reserve (unsigned EltCount)
 reserve - Increase the number of buckets such that adding the EltCount-th node won't cause a rebucket operation.
 
bool RemoveNode (T *N)
 RemoveNode - 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)
 GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it.
 
TFindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos)
 FindNodeOrInsertPos - Look up the node specified by ID.
 
void InsertNode (T *N, void *InsertPos)
 InsertNode - Insert the specified node into the folding set, knowing that it is not already in the folding set.
 
void InsertNode (T *N)
 InsertNode - 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
void clear ()
 clear - Remove all nodes from the folding set.
 
unsigned size () const
 size - Returns the number of nodes in the folding set.
 
bool empty () const
 empty - Returns true if there are no nodes in the folding set.
 
unsigned capacity ()
 capacity - Returns the number of nodes permitted in the folding set before a rebucket operation is performed.
 

Protected Member Functions

 FoldingSetImpl (unsigned Log2InitSize)
 
 FoldingSetImpl (FoldingSetImpl &&Arg)=default
 
FoldingSetImploperator= (FoldingSetImpl &&RHS)=default
 
 ~FoldingSetImpl ()=default
 
- Protected Member Functions inherited from llvm::FoldingSetBase
 FoldingSetBase (unsigned Log2InitSize=6)
 
 FoldingSetBase (FoldingSetBase &&Arg)
 
FoldingSetBaseoperator= (FoldingSetBase &&RHS)
 
 ~FoldingSetBase ()
 
void reserve (unsigned EltCount, const FoldingSetInfo &Info)
 reserve - Increase the number of buckets such that adding the EltCount-th node won't cause a rebucket operation.
 
bool RemoveNode (Node *N)
 RemoveNode - Remove a node from the folding set, returning true if one was removed or false if the node was not in the folding set.
 
NodeGetOrInsertNode (Node *N, const FoldingSetInfo &Info)
 GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it.
 
NodeFindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos, const FoldingSetInfo &Info)
 FindNodeOrInsertPos - Look up the node specified by ID.
 
void InsertNode (Node *N, void *InsertPos, const FoldingSetInfo &Info)
 InsertNode - Insert the specified node into the folding set, knowing that it is not already in the folding set.
 

Additional Inherited Members

- Protected Attributes inherited from llvm::FoldingSetBase
void ** Buckets
 Buckets - Array of bucket chains.
 
unsigned NumBuckets
 NumBuckets - Length of the Buckets array. Always a power of 2.
 
unsigned NumNodes
 NumNodes - Number of nodes in the folding set.
 

Detailed Description

template<class Derived, class T>
class llvm::FoldingSetImpl< Derived, T >

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

Definition at line 451 of file FoldingSet.h.

Member Typedef Documentation

◆ bucket_iterator

template<class Derived , class T >
using llvm::FoldingSetImpl< Derived, T >::bucket_iterator = FoldingSetBucketIterator<T>

Definition at line 471 of file FoldingSet.h.

◆ const_iterator

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

Definition at line 466 of file FoldingSet.h.

◆ iterator

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

Definition at line 461 of file FoldingSet.h.

Constructor & Destructor Documentation

◆ FoldingSetImpl() [1/2]

template<class Derived , class T >
llvm::FoldingSetImpl< Derived, T >::FoldingSetImpl ( unsigned  Log2InitSize)
inlineexplicitprotected

Definition at line 453 of file FoldingSet.h.

◆ FoldingSetImpl() [2/2]

template<class Derived , class T >
llvm::FoldingSetImpl< Derived, T >::FoldingSetImpl ( FoldingSetImpl< Derived, T > &&  Arg)
protecteddefault

◆ ~FoldingSetImpl()

template<class Derived , class T >
llvm::FoldingSetImpl< Derived, T >::~FoldingSetImpl ( )
protecteddefault

Member Function Documentation

◆ begin() [1/2]

template<class Derived , class T >
iterator llvm::FoldingSetImpl< Derived, T >::begin ( )
inline

Definition at line 463 of file FoldingSet.h.

References llvm::FoldingSetBase::Buckets.

◆ begin() [2/2]

template<class Derived , class T >
const_iterator llvm::FoldingSetImpl< Derived, T >::begin ( ) const
inline

Definition at line 468 of file FoldingSet.h.

References llvm::FoldingSetBase::Buckets.

◆ bucket_begin()

template<class Derived , class T >
bucket_iterator llvm::FoldingSetImpl< Derived, T >::bucket_begin ( unsigned  hash)
inline

◆ bucket_end()

template<class Derived , class T >
bucket_iterator llvm::FoldingSetImpl< Derived, T >::bucket_end ( unsigned  hash)
inline

◆ end() [1/2]

template<class Derived , class T >
iterator llvm::FoldingSetImpl< Derived, T >::end ( )
inline

◆ end() [2/2]

template<class Derived , class T >
const_iterator llvm::FoldingSetImpl< Derived, T >::end ( ) const
inline

◆ FindNodeOrInsertPos()

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

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

References llvm::FoldingSetBase::FindNodeOrInsertPos().

Referenced by llvm::ImmutableListFactory< T >::concat(), llvm::PMTopLevelManager::findAnalysisUsage(), and llvm::RecordRecTy::get().

◆ GetOrInsertNode()

template<class Derived , class T >
T * llvm::FoldingSetImpl< Derived, T >::GetOrInsertNode ( T N)
inline

GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it.

Otherwise, insert 'N' and return it instead.

Definition at line 497 of file FoldingSet.h.

References llvm::FoldingSetBase::GetOrInsertNode(), and N.

Referenced by llvm::FoldingSetImpl< Derived, T >::InsertNode().

◆ InsertNode() [1/2]

template<class Derived , class T >
void llvm::FoldingSetImpl< Derived, T >::InsertNode ( T N)
inline

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

Definition at line 519 of file FoldingSet.h.

References assert(), llvm::FoldingSetImpl< Derived, T >::GetOrInsertNode(), and N.

◆ InsertNode() [2/2]

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

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

References llvm::FoldingSetBase::InsertNode(), and N.

Referenced by llvm::ImmutableListFactory< T >::concat(), llvm::PMTopLevelManager::findAnalysisUsage(), and llvm::RecordRecTy::get().

◆ operator=()

template<class Derived , class T >
FoldingSetImpl & llvm::FoldingSetImpl< Derived, T >::operator= ( FoldingSetImpl< Derived, T > &&  RHS)
protecteddefault

◆ RemoveNode()

template<class Derived , class T >
bool llvm::FoldingSetImpl< Derived, T >::RemoveNode ( T N)
inline

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

References N, and llvm::FoldingSetBase::RemoveNode().

◆ reserve()

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

reserve - Increase the number of buckets such that adding the EltCount-th node won't cause a rebucket operation.

reserve is permitted to allocate more space than requested by EltCount.

Definition at line 484 of file FoldingSet.h.

References llvm::FoldingSetBase::reserve().


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