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 | |
|---|---|
| LLVM_ABI 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 | |
|---|---|
| LLVM_ABI | FoldingSetBase (unsigned Log2InitSize=6) |
| LLVM_ABI | FoldingSetBase (FoldingSetBase &&Arg) |
| LLVM_ABI FoldingSetBase & | operator= (FoldingSetBase &&RHS) |
| LLVM_ABI | ~FoldingSetBase () |
| LLVM_ABI 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. | |
| LLVM_ABI 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. | |
| LLVM_ABI Node * | GetOrInsertNode (Node *N, const FoldingSetInfo &Info) |
| GetOrInsertNode - If there is an existing simple Node exactly equal to the specified node, return it. | |
| LLVM_ABI Node * | FindNodeOrInsertPos (const FoldingSetNodeID &ID, void *&InsertPos, const FoldingSetInfo &Info) |
| FindNodeOrInsertPos - Look up the node specified by ID. | |
| LLVM_ABI 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 118 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 159 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(), N, llvm::Next, NumBuckets, and NumNodes.
Referenced by GetOrInsertNode(), and llvm::FoldingSetImpl< FoldingSet, 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 156 of file FoldingSet.h.
References NumNodes.
◆ Buckets
| void** llvm::FoldingSetBase::Buckets | protected |
|---|
Buckets - Array of bucket chains.
Definition at line 121 of file FoldingSet.h.
Referenced by llvm::FoldingSetImpl< FoldingSet, T >::begin(), llvm::FoldingSetImpl< FoldingSet, T >::begin(), llvm::FoldingSetImpl< FoldingSet, T >::bucket_begin(), llvm::FoldingSetImpl< FoldingSet, T >::bucket_end(), clear(), llvm::FoldingSetImpl< FoldingSet, T >::end(), llvm::FoldingSetImpl< FoldingSet, T >::end(), FindNodeOrInsertPos(), FoldingSetBase(), 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 124 of file FoldingSet.h.
Referenced by llvm::FoldingSetImpl< FoldingSet, T >::bucket_begin(), llvm::FoldingSetImpl< FoldingSet, T >::bucket_end(), capacity(), clear(), llvm::FoldingSetImpl< FoldingSet, T >::end(), llvm::FoldingSetImpl< FoldingSet, T >::end(), FindNodeOrInsertPos(), FoldingSetBase(), FoldingSetBase(), InsertNode(), and operator=().
◆ NumNodes
The documentation for this class was generated from the following files:
- include/llvm/ADT/FoldingSet.h
- lib/Support/FoldingSet.cpp