LLVM 23.0.0git
llvm::ContextualFoldingSet< T, Ctx > Class Template Reference

This template class is a further refinement of FoldingSet which provides a context argument when calling Profile on its nodes. More...

#include "llvm/ADT/FoldingSet.h"

Inheritance diagram for llvm::ContextualFoldingSet< T, Ctx >:
[legend]

Public Member Functions

 ContextualFoldingSet (Ctx Context, unsigned Log2InitSize=6)
Ctx getContext () const
Public Member Functions inherited from llvm::FoldingSetImpl< ContextualFoldingSet< T, Ctx >, T >
iterator begin ()
iterator end ()
bucket_iterator bucket_begin (unsigned hash)
bucket_iterator bucket_end (unsigned hash)
void reserve (unsigned EltCount)
 Increase the number of buckets such that adding the EltCount th node won't cause a rebucket operation.
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 simple 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.
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 ()
 Returns the number of nodes permitted in the folding set before a rebucket operation is performed.

Additional Inherited Members

Public Types inherited from llvm::FoldingSetImpl< ContextualFoldingSet< T, Ctx >, T >
using iterator
using const_iterator
using bucket_iterator
Protected Member Functions inherited from llvm::FoldingSetImpl< ContextualFoldingSet< T, Ctx >, T >
 FoldingSetImpl (unsigned Log2InitSize)
FoldingSetImploperator= (FoldingSetImpl &&RHS)=default
 ~FoldingSetImpl ()=default
Protected Member Functions inherited from llvm::FoldingSetBase
LLVM_ABI FoldingSetBase (unsigned Log2InitSize=6)
LLVM_ABI FoldingSetBase (FoldingSetBase &&Arg)
LLVM_ABI FoldingSetBaseoperator= (FoldingSetBase &&RHS)
LLVM_ABI ~FoldingSetBase ()
LLVM_ABI void reserve (unsigned EltCount, const FoldingSetInfo &Info)
 Increase the number of buckets such that adding the EltCount th node won't cause a rebucket operation.
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 simple 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 Ctx>
class llvm::ContextualFoldingSet< T, Ctx >

This template class is a further refinement of FoldingSet which provides a context argument when calling Profile on its nodes.

Currently, that argument is fixed at initialization time.

T must be a subclass of FoldingSetNode and implement a Profile function with signature void Profile(FoldingSetNodeID &, Ctx);

Definition at line 580 of file FoldingSet.h.

Constructor & Destructor Documentation

◆ ContextualFoldingSet()

template<class T, class Ctx>
llvm::ContextualFoldingSet< T, Ctx >::ContextualFoldingSet ( Ctx Context,
unsigned Log2InitSize = 6 )
inlineexplicit

Definition at line 627 of file FoldingSet.h.

Member Function Documentation

◆ getContext()

template<class T, class Ctx>
Ctx llvm::ContextualFoldingSet< T, Ctx >::getContext ( ) const
inline

Definition at line 630 of file FoldingSet.h.


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