LLVM  6.0.0svn
Public Types | Public Member Functions | Protected Member Functions | List of all members
llvm::FoldingSetImpl< T > Class Template Reference

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

#include "llvm/ADT/FoldingSet.h"

Inheritance diagram for llvm::FoldingSetImpl< T >:
Inheritance graph
[legend]
Collaboration diagram for llvm::FoldingSetImpl< T >:
Collaboration graph
[legend]

Public Types

typedef FoldingSetIterator< Titerator
 
typedef FoldingSetIterator< const Tconst_iterator
 
typedef FoldingSetBucketIterator< Tbucket_iterator
 

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

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 ()
 
virtual void GetNodeProfile (Node *N, FoldingSetNodeID &ID) const =0
 GetNodeProfile - Instantiations of the FoldingSet template implement this function to gather data bits for the given node. More...
 
virtual bool NodeEquals (Node *N, const FoldingSetNodeID &ID, unsigned IDHash, FoldingSetNodeID &TempID) const =0
 NodeEquals - Instantiations of the FoldingSet template implement this function to compare the given node with the given ID. More...
 
virtual unsigned ComputeNodeHash (Node *N, FoldingSetNodeID &TempID) const =0
 ComputeNodeHash - Instantiations of the FoldingSet template implement this function to compute a hash value for the given node. More...
 
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. More...
 
NodeGetOrInsertNode (Node *N)
 GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it. More...
 
NodeFindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos)
 FindNodeOrInsertPos - Look up the node specified by ID. More...
 
void InsertNode (Node *N, void *InsertPos)
 InsertNode - Insert the specified node into the folding set, knowing that it is not already in the folding set. More...
 

Additional Inherited Members

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

Detailed Description

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

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

Definition at line 408 of file FoldingSet.h.

Member Typedef Documentation

◆ bucket_iterator

Definition at line 426 of file FoldingSet.h.

◆ const_iterator

Definition at line 422 of file FoldingSet.h.

◆ iterator

template<class T>
typedef FoldingSetIterator<T> llvm::FoldingSetImpl< T >::iterator

Definition at line 418 of file FoldingSet.h.

Constructor & Destructor Documentation

◆ FoldingSetImpl() [1/2]

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

Definition at line 410 of file FoldingSet.h.

◆ FoldingSetImpl() [2/2]

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

◆ ~FoldingSetImpl()

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

Member Function Documentation

◆ begin() [1/2]

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

Definition at line 419 of file FoldingSet.h.

◆ begin() [2/2]

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

Definition at line 423 of file FoldingSet.h.

◆ bucket_begin()

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

Definition at line 428 of file FoldingSet.h.

◆ bucket_end()

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

Definition at line 432 of file FoldingSet.h.

◆ end() [1/2]

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

Definition at line 420 of file FoldingSet.h.

◆ end() [2/2]

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

Definition at line 424 of file FoldingSet.h.

◆ FindNodeOrInsertPos()

template<class T>
T* llvm::FoldingSetImpl< 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 450 of file FoldingSet.h.

Referenced by llvm::FoldingSetVector< T, VectorT >::FindNodeOrInsertPos(), llvm::BitsInit::get(), llvm::ListInit::get(), llvm::UnOpInit::get(), llvm::BinOpInit::get(), llvm::TernOpInit::get(), and llvm::DagInit::get().

◆ GetOrInsertNode()

template<class T>
T* llvm::FoldingSetImpl< 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 443 of file FoldingSet.h.

Referenced by llvm::FoldingSetVector< T, VectorT >::GetOrInsertNode().

◆ InsertNode() [1/2]

template<class T>
void llvm::FoldingSetImpl< 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 457 of file FoldingSet.h.

Referenced by llvm::BitsInit::get(), llvm::ListInit::get(), llvm::UnOpInit::get(), llvm::BinOpInit::get(), llvm::TernOpInit::get(), llvm::DagInit::get(), llvm::SelectionDAG::getTargetMemSDNode(), and llvm::FoldingSetVector< T, VectorT >::InsertNode().

◆ InsertNode() [2/2]

template<class T>
void llvm::FoldingSetImpl< 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 463 of file FoldingSet.h.

◆ operator=()

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

◆ RemoveNode()

template<class T>
bool llvm::FoldingSetImpl< 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 438 of file FoldingSet.h.


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