class FoldingSetBase
Declaration
class FoldingSetBase { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:112
Member Variables
- protected void** Buckets
- Buckets - Array of bucket chains.
- protected unsigned int NumBuckets
- NumBuckets - Length of the Buckets array. Always a power of 2.
- protected unsigned int NumNodes
- NumNodes - Number of nodes in the folding set. Growth occurs when NumNodes is greater than twice the number of buckets.
Method Overview
- protected virtual unsigned int ComputeNodeHash(llvm::FoldingSetBase::Node * N, llvm::FoldingSetNodeID & TempID) const
- protected llvm::FoldingSetBase::Node * FindNodeOrInsertPos(const llvm::FoldingSetNodeID & ID, void *& InsertPos)
- protected FoldingSetBase(unsigned int Log2InitSize = 6)
- protected FoldingSetBase(llvm::FoldingSetBase && Arg)
- protected virtual void GetNodeProfile(llvm::FoldingSetBase::Node * N, llvm::FoldingSetNodeID & ID) const
- protected llvm::FoldingSetBase::Node * GetOrInsertNode(llvm::FoldingSetBase::Node * N)
- protected void InsertNode(llvm::FoldingSetBase::Node * N, void * InsertPos)
- protected virtual bool NodeEquals(llvm::FoldingSetBase::Node * N, const llvm::FoldingSetNodeID & ID, unsigned int IDHash, llvm::FoldingSetNodeID & TempID) const
- protected bool RemoveNode(llvm::FoldingSetBase::Node * N)
- public unsigned int capacity()
- public void clear()
- public bool empty() const
- public void reserve(unsigned int EltCount)
- public unsigned int size() const
- protected ~FoldingSetBase()
Methods
¶virtual unsigned int ComputeNodeHash(
llvm::FoldingSetBase::Node* N,
llvm::FoldingSetNodeID& TempID) const
virtual unsigned int ComputeNodeHash(
llvm::FoldingSetBase::Node* N,
llvm::FoldingSetNodeID& TempID) const
Description
ComputeNodeHash - Instantiations of the FoldingSet template implement this function to compute a hash value for the given node.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:191
Parameters
¶llvm::FoldingSetBase::Node* FindNodeOrInsertPos(
const llvm::FoldingSetNodeID& ID,
void*& InsertPos)
llvm::FoldingSetBase::Node* FindNodeOrInsertPos(
const llvm::FoldingSetNodeID& ID,
void*& InsertPos)
Description
FindNodeOrInsertPos - Look up the node specified by ID. If it exists, return it. If not, return the insertion token that will make insertion faster.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:208
Parameters
- const llvm::FoldingSetNodeID& ID
- void*& InsertPos
¶FoldingSetBase(unsigned int Log2InitSize = 6)
FoldingSetBase(unsigned int Log2InitSize = 6)
Declared at: llvm/include/llvm/ADT/FoldingSet.h:126
Parameters
- unsigned int Log2InitSize = 6
¶FoldingSetBase(llvm::FoldingSetBase&& Arg)
FoldingSetBase(llvm::FoldingSetBase&& Arg)
Declared at: llvm/include/llvm/ADT/FoldingSet.h:127
Parameters
- llvm::FoldingSetBase&& Arg
¶virtual void GetNodeProfile(
llvm::FoldingSetBase::Node* N,
llvm::FoldingSetNodeID& ID) const
virtual void GetNodeProfile(
llvm::FoldingSetBase::Node* N,
llvm::FoldingSetNodeID& ID) const
Description
GetNodeProfile - Instantiations of the FoldingSet template implement this function to gather data bits for the given node.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:182
Parameters
¶llvm::FoldingSetBase::Node* GetOrInsertNode(
llvm::FoldingSetBase::Node* N)
llvm::FoldingSetBase::Node* GetOrInsertNode(
llvm::FoldingSetBase::Node* N)
Description
GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it. Otherwise, insert 'N' and return it instead.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:203
Parameters
¶void InsertNode(llvm::FoldingSetBase::Node* N,
void* InsertPos)
void InsertNode(llvm::FoldingSetBase::Node* N,
void* InsertPos)
Description
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.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:213
Parameters
- llvm::FoldingSetBase::Node* N
- void* InsertPos
¶virtual bool NodeEquals(
llvm::FoldingSetBase::Node* N,
const llvm::FoldingSetNodeID& ID,
unsigned int IDHash,
llvm::FoldingSetNodeID& TempID) const
virtual bool NodeEquals(
llvm::FoldingSetBase::Node* N,
const llvm::FoldingSetNodeID& ID,
unsigned int IDHash,
llvm::FoldingSetNodeID& TempID) const
Description
NodeEquals - Instantiations of the FoldingSet template implement this function to compare the given node with the given ID.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:186
Parameters
- llvm::FoldingSetBase::Node* N
- const llvm::FoldingSetNodeID& ID
- unsigned int IDHash
- llvm::FoldingSetNodeID& TempID
¶bool RemoveNode(llvm::FoldingSetBase::Node* N)
bool RemoveNode(llvm::FoldingSetBase::Node* N)
Description
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.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:198
Parameters
¶unsigned int capacity()
unsigned int capacity()
Description
capacity - Returns the number of nodes permitted in the folding set before a rebucket operation is performed.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:164
¶void clear()
void clear()
Description
clear - Remove all nodes from the folding set.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:149
¶bool empty() const
bool empty() const
Description
empty - Returns true if there are no nodes in the folding set.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:155
¶void reserve(unsigned int EltCount)
void reserve(unsigned int EltCount)
Description
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.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:160
Parameters
- unsigned int EltCount
¶unsigned int size() const
unsigned int size() const
Description
size - Returns the number of nodes in the folding set.
Declared at: llvm/include/llvm/ADT/FoldingSet.h:152
¶~FoldingSetBase()
~FoldingSetBase()
Declared at: llvm/include/llvm/ADT/FoldingSet.h:129