LLVM: llvm::FoldingSetBase Class Reference (original) (raw)

FoldingSetBase - Implements the folding set functionality. More...

#include "[llvm/ADT/FoldingSet.h](FoldingSet%5F8h%5Fsource.html)"

Classes
struct FoldingSetInfo
Functions provided by the derived class to compute folding properties. More...
class Node
Node - This class is used to maintain the singly linked bucket list in a folding set. More...
Public Member Functions
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
FoldingSetBase (unsigned Log2InitSize=6)
FoldingSetBase (FoldingSetBase &&Arg)
FoldingSetBase & operator= (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.
Node * GetOrInsertNode (Node *N, const FoldingSetInfo &Info)
GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it.
Node * FindNodeOrInsertPos (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.
Protected Attributes
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.

FoldingSetBase - Implements the folding set functionality.

The main structure is an array of buckets. Each bucket is indexed by the hash of the nodes it contains. The bucket itself points to the nodes contained in the bucket via a singly linked list. The last node in the list points back to the bucket to facilitate node removal.

Definition at line 117 of file FoldingSet.h.

FoldingSetBase::FoldingSetBase ( unsigned Log2InitSize = 6) explicitprotected

FoldingSetBase() [2/2]

~FoldingSetBase()

FoldingSetBase::~FoldingSetBase ( ) protected

capacity()

unsigned llvm::FoldingSetBase::capacity ( ) inline

clear()

void FoldingSetBase::clear ( )

empty()

bool llvm::FoldingSetBase::empty ( ) const inline

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

Definition at line 158 of file FoldingSet.h.

References NumNodes.

FindNodeOrInsertPos()

GetOrInsertNode()

InsertNode()

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

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

InsertPos must be obtained from FindNodeOrInsertPos.

The insert position is actually a bucket pointer.

Definition at line 303 of file FoldingSet.cpp.

References assert(), Buckets, capacity(), GetBucketFor(), Info, N, NumBuckets, and NumNodes.

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

operator=()

RemoveNode()

bool FoldingSetBase::RemoveNode ( Node * N) protected

reserve()

size()

unsigned llvm::FoldingSetBase::size ( ) const inline

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

Definition at line 155 of file FoldingSet.h.

References NumNodes.

Buckets

void** llvm::FoldingSetBase::Buckets protected

Buckets - Array of bucket chains.

Definition at line 120 of file FoldingSet.h.

Referenced by llvm::FoldingSetImpl< Derived, T >::begin(), llvm::FoldingSetImpl< Derived, T >::bucket_begin(), llvm::FoldingSetImpl< Derived, T >::bucket_end(), clear(), llvm::FoldingSetImpl< Derived, T >::end(), FindNodeOrInsertPos(), FoldingSetBase(), InsertNode(), operator=(), and ~FoldingSetBase().

NumBuckets

unsigned llvm::FoldingSetBase::NumBuckets protected

NumBuckets - Length of the Buckets array. Always a power of 2.

Definition at line 123 of file FoldingSet.h.

Referenced by llvm::FoldingSetImpl< Derived, T >::bucket_begin(), llvm::FoldingSetImpl< Derived, T >::bucket_end(), capacity(), clear(), llvm::FoldingSetImpl< Derived, T >::end(), FindNodeOrInsertPos(), FoldingSetBase(), InsertNode(), and operator=().

NumNodes


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