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

FoldingSetVector - This template class combines a FoldingSet and a vector to provide the interface of FoldingSet but with deterministic iteration order based on the insertion order. More...

#include "llvm/ADT/FoldingSet.h"

Public Types

using iterator = pointee_iterator< typename VectorT::iterator >
 
using const_iterator = pointee_iterator< typename VectorT::const_iterator >
 

Public Member Functions

 FoldingSetVector (unsigned Log2InitSize=6)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void clear ()
 clear - Remove all nodes from the folding set.
 
TFindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos)
 FindNodeOrInsertPos - Look up the node specified by ID.
 
TGetOrInsertNode (T *N)
 GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it.
 
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.
 
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.
 

Detailed Description

template<class T, class VectorT = SmallVector<T*, 8>>
class llvm::FoldingSetVector< T, VectorT >

FoldingSetVector - This template class combines a FoldingSet and a vector to provide the interface of FoldingSet but with deterministic iteration order based on the insertion order.

T must be a subclass of FoldingSetNode and implement a Profile function.

Definition at line 647 of file FoldingSet.h.

Member Typedef Documentation

◆ const_iterator

template<class T , class VectorT = SmallVector<T*, 8>>
using llvm::FoldingSetVector< T, VectorT >::const_iterator = pointee_iterator<typename VectorT::const_iterator>

Definition at line 659 of file FoldingSet.h.

◆ iterator

template<class T , class VectorT = SmallVector<T*, 8>>
using llvm::FoldingSetVector< T, VectorT >::iterator = pointee_iterator<typename VectorT::iterator>

Definition at line 654 of file FoldingSet.h.

Constructor & Destructor Documentation

◆ FoldingSetVector()

template<class T , class VectorT = SmallVector<T*, 8>>
llvm::FoldingSetVector< T, VectorT >::FoldingSetVector ( unsigned  Log2InitSize = 6)
inlineexplicit

Definition at line 652 of file FoldingSet.h.

Member Function Documentation

◆ begin() [1/2]

template<class T , class VectorT = SmallVector<T*, 8>>
iterator llvm::FoldingSetVector< T, VectorT >::begin ( )
inline

Definition at line 656 of file FoldingSet.h.

References llvm::Vector.

◆ begin() [2/2]

template<class T , class VectorT = SmallVector<T*, 8>>
const_iterator llvm::FoldingSetVector< T, VectorT >::begin ( ) const
inline

Definition at line 661 of file FoldingSet.h.

References llvm::Vector.

◆ clear()

template<class T , class VectorT = SmallVector<T*, 8>>
void llvm::FoldingSetVector< T, VectorT >::clear ( )
inline

clear - Remove all nodes from the folding set.

Definition at line 665 of file FoldingSet.h.

References llvm::Vector.

◆ empty()

template<class T , class VectorT = SmallVector<T*, 8>>
bool llvm::FoldingSetVector< T, VectorT >::empty ( ) const
inline

empty - Returns true if there are no nodes in the folding set.

Definition at line 702 of file FoldingSet.h.

◆ end() [1/2]

template<class T , class VectorT = SmallVector<T*, 8>>
iterator llvm::FoldingSetVector< T, VectorT >::end ( )
inline

Definition at line 657 of file FoldingSet.h.

References llvm::Vector.

◆ end() [2/2]

template<class T , class VectorT = SmallVector<T*, 8>>
const_iterator llvm::FoldingSetVector< T, VectorT >::end ( ) const
inline

Definition at line 662 of file FoldingSet.h.

References llvm::Vector.

◆ FindNodeOrInsertPos()

template<class T , class VectorT = SmallVector<T*, 8>>
T * llvm::FoldingSetVector< T, VectorT >::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 670 of file FoldingSet.h.

◆ GetOrInsertNode()

template<class T , class VectorT = SmallVector<T*, 8>>
T * llvm::FoldingSetVector< T, VectorT >::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 677 of file FoldingSet.h.

References N, and llvm::Vector.

◆ InsertNode() [1/2]

template<class T , class VectorT = SmallVector<T*, 8>>
void llvm::FoldingSetVector< T, VectorT >::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 693 of file FoldingSet.h.

References N, and llvm::Vector.

◆ InsertNode() [2/2]

template<class T , class VectorT = SmallVector<T*, 8>>
void llvm::FoldingSetVector< T, VectorT >::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 686 of file FoldingSet.h.

References N, and llvm::Vector.

◆ size()

template<class T , class VectorT = SmallVector<T*, 8>>
unsigned llvm::FoldingSetVector< T, VectorT >::size ( ) const
inline

size - Returns the number of nodes in the folding set.

Definition at line 699 of file FoldingSet.h.


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